Skip to content

Rate limiting #12134

Answered by Janpot
jack-pallot asked this question in Help
Apr 23, 2020 · 4 comments · 10 replies
Discussion options

You must be logged in to vote

If bad actors are your concern, I don't think a cache-control header is going to stop them from hammering the endpoint.

There isn't much information about your architecture but there's three points I see where you could add rate-limiting:

  1. Personally I'd start by looking into whether your serverless database offers any rate-limiting features.
  2. Otherwise, depending on the way you're hosting your app, if you have a reverse proxy available that has rate-limiting features, I'd use that.
  3. Otherwise, since next.js API routes allow using existing connect middleware, you should be able to rate limit with one of the available rate-limiting middleware

Replies: 4 comments 10 replies

Comment options

You must be logged in to vote
2 replies
@timneutkens
Comment options

@leerob
Comment options

Comment options

You must be logged in to vote
2 replies
@GaddMaster
Comment options

@ExordiumX
Comment options

Answer selected by jack-pallot
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@Toumash
Comment options

@leerob
Comment options

@justinbalaguer
Comment options

@leerob
Comment options

@ghost
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
9 participants