In this post, we will create a waiting room for your Next.js application using Vercel Edge functions and Upstash Redis.
The waiting room is useful when you want to limit the number of active visitors to your website so as not to overload your resources.
In our implementation, you will be able to set a maximum number of active visitors. There will two parameters to control the traffic:
- Max website capacity: Max number of visitors in the website at the same time?
- Max session timeout: Max number of seconds that a visitor can stay idle