Fix mobile view Bugs and add versions to static files for cache breaking

This commit is contained in:
Florian Zumpe
2026-06-17 17:29:39 +02:00
parent 13770f21e3
commit 7760ae4f49
12 changed files with 77 additions and 48 deletions
+13 -1
View File
@@ -18,7 +18,19 @@ app.use(express.json({
}));
app.use(express.urlencoded({ extended: true, limit: '2mb' }));
app.use('/api', createApiRouter(db));
app.use(express.static(path.join(__dirname, 'public'), { extensions: ['html'] }));
app.use(express.static(path.join(__dirname, 'public'), {
extensions: ['html'],
etag: true,
lastModified: true,
maxAge: 0,
setHeaders(res, filePath) {
if (filePath.endsWith('.html')) {
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
return;
}
res.setHeader('Cache-Control', 'public, max-age=0, must-revalidate');
}
}));
app.use(notFoundHandler);
app.use(errorHandler);