Skip to content

Commit

Permalink
Fix caching issues upon upgrade
Browse files Browse the repository at this point in the history
Disables caching for `index.html` and `config.json`. Assets (i.e. CSS, JS files) already have a unique value in their name for cache busting across builds.

Fixes #860

Signed-off-by: nscuro <nscuro@protonmail.com>
  • Loading branch information
nscuro committed Oct 9, 2024
1 parent 4fdb56e commit e0e9aad
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docker/etc/nginx/templates/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ server {
index index.html;
try_files $uri $uri/ /index.html;

location ~ (config\.json|index\.html)$ {
add_header Cache-Control "max-age=0, no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
add_header Expires 0;
}

sub_filter '<base href=/' '<base href=${BASE_PATH}';
sub_filter_once on;
}
Expand All @@ -16,4 +22,4 @@ server {
location = /50x.html {
root /usr/share/nginx/html;
}
}
}

0 comments on commit e0e9aad

Please sign in to comment.