diff --git a/README.md b/README.md index bb17cca..39a3cd8 100644 --- a/README.md +++ b/README.md @@ -125,20 +125,12 @@ Use images to complement your responses, powered by Brave. ## Rate Limits -### WAF Protection (Cloudflare Free) +Limits change over time, so they aren't listed here. **Check the Rate Limits section on [direct-img.link](https://direct-img.link) for the current limits.** -| Rule | Limit | Action | -|---|---|---| -| Rate Limit | ~10 requests/10s per IP | HTTP 429 for ~10s | - -### New Searches (Cache Misses) - -- **35 new searches per day per IP** on `direct-img.link` and **100** on `free.direct-img.link` (separate counters, reset at midnight UTC), then `limit.webp` is served -- **Cache hits are unlimited** (within WAF limits above) +- **New searches (cache misses)** are limited per IP per day, then `limit.webp` is served. `direct-img.link` and `free.direct-img.link` have separate counters, both reset at midnight UTC +- **Cache hits are unlimited** (within the burst limit) - Failed searches count toward the limit and are remembered for 24h (`bad.webp`) -- WAF counters are approximate (not shared perfectly across Cloudflare servers), so bursts may slip slightly past 10 -- **Brave API quota:** $5 free monthly credits (1,000 queries), then $5/1k requests -- **Openverse & Wikimedia:** free, no quota costs +- A Cloudflare WAF burst limit applies to all requests (HTTP 429). Its counters are approximate (not shared perfectly across Cloudflare servers), so bursts may slip slightly past it ## Caching diff --git a/assets/rate-limit.js b/assets/rate-limit.js index e9e268b..9d863b9 100644 --- a/assets/rate-limit.js +++ b/assets/rate-limit.js @@ -1,6 +1,5 @@ // New searches (cache misses) allowed per IP per day, reset at 00:00 UTC. Cache hits never count. -// Safe to edit by hand. Imported by the worker and by the homepage (as a static file, so no Functions quota); -// README.md needs a manual update. +// Safe to edit by hand. Imported by the worker and by the homepage (as a static file, so no Functions quota). // The burst limit (~10 req/10s) is a Cloudflare WAF rule, not set here. export const DAILY_LIMIT = 25; export const FREE_DAILY_LIMIT = 100;