feat: adds caching of asset files #13

Merged
devydave merged 1 commits from feat-cache-assets into main 2026-02-21 09:27:02 +00:00

View File

@ -8,6 +8,21 @@ server {
try_files $uri $uri/index.html =404;
}
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
# max-age must be in seconds
add_header Cache-Control "max-age=2629746, public";
}
# CSS and Javascript
location ~* \.(?:css|js|ttf|otf|woff2|woff)$ {
expires 1y;
access_log off;
add_header Cache-Control "max-age=31556952, public";
}
location /deploy {
{{ if eq (env "AUTH_ENABLED") "1" }}
auth_basic "Administrators Area";