mirror of
https://github.com/zoriya/flood.git
synced 2025-12-06 07:16:18 +00:00
server: prohibit caching of index.html
This commit is contained in:
@@ -53,15 +53,26 @@ if (config.serveAssets !== false) {
|
|||||||
encoding: 'utf8',
|
encoding: 'utf8',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Prohibit caching of index.html as browser can use a fully cached asset
|
||||||
|
// tree in some cases, which defeats cache busting by asset hashes.
|
||||||
|
const headers = {
|
||||||
|
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
||||||
|
Pragma: 'no-cache',
|
||||||
|
Expires: '0',
|
||||||
|
};
|
||||||
|
|
||||||
app.get(`${servedPath}login`, (_req, res) => {
|
app.get(`${servedPath}login`, (_req, res) => {
|
||||||
|
res.set(headers);
|
||||||
res.send(html);
|
res.send(html);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get(`${servedPath}register`, (_req, res) => {
|
app.get(`${servedPath}register`, (_req, res) => {
|
||||||
|
res.set(headers);
|
||||||
res.send(html);
|
res.send(html);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get(`${servedPath}overview`, (_req, res) => {
|
app.get(`${servedPath}overview`, (_req, res) => {
|
||||||
|
res.set(headers);
|
||||||
res.send(html);
|
res.send(html);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user