Files
direct-img.link/public/_headers
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

15 lines
544 B
Plaintext

# Promoted images (scripts/promote.js) have no file extension, so they'd go out without a Content-Type. Browsers detect
# JPEG, PNG, GIF and WebP from the bytes whatever type is declared, so promote.js promotes only those.
/web/*
Content-Type: image/jpeg
Cache-Control: public, max-age=604800
Access-Control-Allow-Origin: *
/free/*
Content-Type: image/jpeg
Cache-Control: public, max-age=604800
Access-Control-Allow-Origin: *
/ai/*
Content-Type: image/jpeg
Cache-Control: public, max-age=604800
Access-Control-Allow-Origin: *