Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion deploy/nginx/triangle-cms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,16 @@ server {
# Filenames encode the exact size, so files are immutable. Set this only
# via add_header -- `expires` would emit a second, weaker Cache-Control
# and CDNs disagree about which duplicate wins.
add_header Cache-Control "public, max-age=2592000, immutable" always;
#
# Deliberately NOT `always`: that flag also stamps 30-day-immutable onto
# 404s, and Cloudflare then pins "this file does not exist" at the edge
# for a month. Any file added to the corpus after something first
# requested it stays invisible until the TTL expires or someone purges --
# a migrated image that is provably on disk and served fine by this nginx
# still 404s publicly, which reads as a failed copy rather than a cache
# hit. Without the flag add_header applies only to 2xx/3xx, so misses
# fall back to Cloudflare's short default 404 TTL and self-heal.
add_header Cache-Control "public, max-age=2592000, immutable";
}

# Never serve dotfiles (keep ACME http-01 working if it is ever added here).
Expand Down
Loading