Add cache-control header for static assets (#281)

This commit is contained in:
Corry Haines 2022-12-27 10:25:18 -08:00 committed by GitHub
parent 07b28c7264
commit b7b0b0dad4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -38,6 +38,9 @@ http {
# Serves static files from the collected dir # Serves static files from the collected dir
location /static/ { location /static/ {
# Files in static have cache-busting hashes in the name, thus can be cached forever
add_header Cache-Control "public, max-age=604800, immutable";
alias /takahe/static-collected/; alias /takahe/static-collected/;
try_files $uri /static//static-real$uri; try_files $uri /static//static-real$uri;
} }