Skip to content

Commit

Permalink
Optimize caching for static files
Browse files Browse the repository at this point in the history
  • Loading branch information
mooxl committed Oct 24, 2023
1 parent d8429c4 commit ca7e679
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions astro/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit ca7e679

Please sign in to comment.