Cache successful static images without caching missing-file errors

This commit is contained in:
Codex 2026-10-30 11:57:35 +08:00
parent b892a4150a
commit 25e0f87d97

View File

@ -4,7 +4,7 @@ location ^~ /images/illustrations/ {
if ($uri !~ "^/images/illustrations/[a-f0-9]{64}\.(webp|png|jpg|gif)$") { return 404; } if ($uri !~ "^/images/illustrations/[a-f0-9]{64}\.(webp|png|jpg|gif)$") { return 404; }
try_files $uri =404; try_files $uri =404;
etag on; etag on;
add_header Cache-Control "public, max-age=31536000, immutable" always; add_header Cache-Control "public, max-age=31536000, immutable";
add_header X-Content-Type-Options nosniff always; add_header X-Content-Type-Options nosniff always;
add_header X-Illustration-Delivery static always; add_header X-Illustration-Delivery static always;
} }