Fix: JSON sanitize fuer Fragmente, bessere Anleitungen; Backend index.html Expires-Header
This commit is contained in:
@@ -88,6 +88,12 @@ app.use(express.static(PUBLIC, {
|
||||
if (filePath.match(/\.(js|css)$/) && !filePath.includes('sw.js')) {
|
||||
res.setHeader('Cache-Control', 'public, max-age=31536000, immutable');
|
||||
}
|
||||
// index.html niemals cachen – auch nicht über express.static
|
||||
if (filePath.endsWith('index.html')) {
|
||||
res.setHeader('Cache-Control', 'no-store, no-cache, must-revalidate');
|
||||
res.setHeader('Pragma', 'no-cache');
|
||||
res.setHeader('Expires', '0');
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -95,6 +101,7 @@ app.use(express.static(PUBLIC, {
|
||||
app.get('*', (_req, res) => {
|
||||
res.setHeader('Cache-Control', 'no-store, no-cache, must-revalidate');
|
||||
res.setHeader('Pragma', 'no-cache');
|
||||
res.setHeader('Expires', '0');
|
||||
res.sendFile(path.join(PUBLIC, 'index.html'));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user