Skip to content

Commit

Permalink
index.html is cached for 6 hours #9796
Browse files Browse the repository at this point in the history
If we don't specify anything, then browsers will make up some value. And chances
are that when we do change index.html, then browsers will not "see" it for a
while, possibly leading to mismatching JS and CSS or more severe issues.

From now on, index.html is cached for a maximum of 6 hours before re-validation.
That means if we release by night, browsers are naturally up-to-date in the
morning. And they use the cached version for most of the day.
  • Loading branch information
PowerKiKi committed Jul 27, 2023
1 parent f71f4eb commit 97d476b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion configuration/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ location ~ ^/(graphql|api/.*)$ {
}

# Cache static files for 6 hours
location ~ \.(svg|jpg|jpeg|png|gif|ico|css|js|otf|eot|ttf|woff)$ {
location ~ index.html|(\.(svg|jpg|jpeg|png|gif|ico|css|js|otf|eot|ttf|webp|woff))$ {
expires 6h;
}

Expand Down

0 comments on commit 97d476b

Please sign in to comment.