Keep hotlink 403s out of CDN and browser caches

The tile hotlink refusal is sent with Cache-Control: no-store from
LuPhoto, Caddy and nginx instead of inheriting the one-year immutable
header. cloudflare.md explains that edge-cached tiles bypass the
origin Referer check, recommends a WAF rule for /t/, and notes that
tile URLs depend only on the photo, the settings and the site key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
lucioandClaude Opus 5.5 committed 2026-11-04 22:49:45 -08:00
1 parent c87aad0254
commit e48a1eacf4
4 files changed
+8 -3

No files matched your search

+1
View File
@@ -85,6 +85,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
settings := h.settings.Load()
clean := path.Clean("/" + r.URL.Path)
if strings.HasPrefix(clean, "/t/") && hotlinked(r, settings.HotlinkAllow) {
header.Set("Cache-Control", "no-store")
http.Error(w, "forbidden", http.StatusForbidden)
return
}