Skip to content

Commit ec50882

Browse files
Williangalvanipatrickelectric
authored andcommitted
frontend: index.html/nginx.conf: add meta tags and headers to hint browser not to cache the html
1 parent 930ab34 commit ec50882

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

core/frontend/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
<link rel="icon" href="/favicon.ico">
88
<title>BlueOS</title>
99
<link rel="stylesheet" href="/userdata/styles/theme_style.css">
10+
<!-- Prevent caching -->
11+
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
12+
<meta http-equiv="Pragma" content="no-cache">
13+
<meta http-equiv="Expires" content="0">
1014
</head>
1115
<body>
1216
<noscript>

core/tools/nginx/nginx.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ http {
216216
autoindex on;
217217
# allow frontend to see files using json
218218
autoindex_format json;
219+
220+
# prevent caching of index.html
221+
if ($uri = /index.html) {
222+
add_header Last-Modified "";
223+
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
224+
}
219225
}
220226

221227
location /assets/ {

0 commit comments

Comments
 (0)