Files
direct-img.link/public/assets/rate-limit.js
T
multipleof4andClaude Opus 5.5 32f742b73f Feat: Move from Pages to a Worker and serve popular images as static files
Static assets don't count toward the free plan's 100,000 requests a day, so a
daily GitHub Action promotes the most viewed images (by Cloudflare analytics)
from R2 into public/ before deploying, and reports to ntfy. Zone rules fold
the site and ?i= into the path, since static files ignore query strings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:08:34 +00:00

7 lines
386 B
JavaScript

// 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).
// The burst limit (~20 req/10s) is a Cloudflare WAF rule, not set here.
export const DAILY_LIMIT = 10;
export const FREE_DAILY_LIMIT = 100;
export const AI_DAILY_LIMIT = 100;