Compare commits
No commits in common. "674dccca4ec7dfbd2b5860a0eee79ae0a2f22062" and "908cf8a62d66f325de47dc8dd86c9995f9607dc4" have entirely different histories.
674dccca4e
...
908cf8a62d
1 changed files with 6 additions and 7 deletions
|
|
@ -18,17 +18,16 @@ server {
|
||||||
# Root location - serve static files
|
# Root location - serve static files
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
|
|
||||||
# Fonts, icons, images: rarely change, safe to cache aggressively.
|
# Cache static assets aggressively
|
||||||
location ~* \.(png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
location ~* \.(css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||||
expires 1y;
|
expires 1y;
|
||||||
add_header Cache-Control "public, immutable";
|
add_header Cache-Control "public, immutable";
|
||||||
}
|
}
|
||||||
|
|
||||||
# CSS / JS — must revalidate so a redeploy is picked up immediately.
|
# JS files — must revalidate so a redeploy is picked up immediately.
|
||||||
# The index.html links these without a version query string, so without
|
# The static index.html links api.js with a ?v=N query string anyway,
|
||||||
# this rule a stale stylesheet/script sits in the browser cache forever
|
# but defence-in-depth: never let a stale .js sit in a browser cache.
|
||||||
# (which produced the unstyled calendar that triggered this fix).
|
location ~* \.js$ {
|
||||||
location ~* \.(css|js)$ {
|
|
||||||
expires -1;
|
expires -1;
|
||||||
add_header Cache-Control "no-cache, must-revalidate";
|
add_header Cache-Control "no-cache, must-revalidate";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue