Next.js Discord

Discord Forum

Are Middlewares a good point to add rate limiting ?

Unanswered
Pacific saury posted this in #help-forum
Open in Discord
Pacific sauryOP
I want to rate limit specifc route handlers, is it correct to do this in middleware and match the routes and add the rate limiting ?

4 Replies

American Crow
yes it is. Here is an example using upstash
https://upstash.com/blog/edge-rate-limiting
Pacific sauryOP
@American Crow one small question, can I use the upstash pacakges with a redis instance which is not on upstash ?