Best practice for rate limiting users of a REST API?

前端 未结 3 1996
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 18:13

I am putting together a REST API and as I\'m unsure how it will scale or what the demand for it will be, I\'d like to be able to rate limit uses of it as well as to be able

3条回答
  •  庸人自扰
    2020-12-12 18:50

    Good answers already - if you don't want to implement the limiter yourself, there are also solutions like 3scale (http://www.3scale.net) which does rate limiting, analytics etc. for APIs. It works using a plugin (see here for the ruby api plugin) which hooks into the 3scale architecture. You can also use it via varnish and have varnish act as a rate limiting proxy.

提交回复
热议问题