weserv / images

Source code of wsrv.nl (formerly images.weserv.nl), to be used on your own server(s).
https://wsrv.nl/
BSD 3-Clause "New" or "Revised" License
1.84k stars 188 forks source link

Rate Limit Redirect #398

Closed onkoe closed 3 months ago

onkoe commented 8 months ago

Hi there! Thanks for the excellent service! I've been using this project on my blog, so my poor little server doesn't have to worry about sending images worldwide!

However, I'm concerned about the rate-limiting - once an IP hits the rate limit, does that mean the server effectively blocks them from seeing images?

If so, does wsrv.nl redirect the users to the original link, or does it just not load the image? Ideally, I'd like to always provide the original link as an option, but I understand if it is not possible to fulfill this request.

Once again, thank you for the awesome project!! 🤩️

kleisauke commented 7 months ago

Once a IP-address hits the rate limit it will response with the 429 Too Many Requests HTTP status code. After that, the IP will be blocked at Cloudflare for 1 hour and response with the 403 Forbidden HTTP status code.

The limit is 2500/10m and is based on the sophisticated generic cell rate algorithm which provides a rolling time window and doesn't depend on a background drip process, so it's unlikely that a typical visitor will be rate-limited unless they abuse the service. Moreover, the rate-limit only applies to uncached requests.

You can check your current rate limit quota here: https://wsrv.nl/quota.

kleisauke commented 3 months ago

I hope this information helped. Please feel free to re-open if questions remain.