Optimize caching for static files

This commit is contained in:
Max Schmidt 2023-10-24 10:05:51 +02:00
parent d8429c43a6
commit ca7e679ebb

View File

@ -24,19 +24,17 @@ http {
internal; internal;
} }
location ~* \.(jpg|jpeg|png|gif|ico|css|html)$ { location ~* \.(jpg|jpeg|png|gif|ico|css|html)$ {
expires 30d; expires 30d;
add_header Pragma public; add_header Pragma public;
add_header Cache-Control "public"; add_header Cache-Control "public";
} }
location ~* \.js$ { location ~* \.js$ {
expires 30d; expires 30d;
add_header Pragma public; add_header Pragma public;
add_header Cache-Control "public"; add_header Cache-Control "public";
add_header Content-Type application/javascript; add_header Content-Type application/javascript;
} }
error_page 404 /404.html; error_page 404 /404.html;
} }
} }