mirror of
https://github.com/direct-img/direct-img.link.git
synced 2026-10-29 07:24:52 +00:00
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>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# 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: *
|
||||
Reference in New Issue
Block a user