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

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