Disable browser caching for CSS and JS files
Build and Push Docker Image / build-and-push (push) Successful in 39s
Build and Push Docker Image / build-and-push (push) Successful in 39s
Prevents stale styles/scripts after deployments. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
402fbfa16d
commit
6a5ac46294
1 file changed
+7
-1
@@ -34,7 +34,13 @@ const PIPER_OK = existsSync(PIPER_MODEL);
|
||||
|
||||
const app = express();
|
||||
app.use(express.json({ limit: '15mb' })); // photos for page-scanning are base64 in the JSON body
|
||||
app.use(express.static(join(ROOT, 'public')));
|
||||
app.use(express.static(join(ROOT, 'public'), {
|
||||
setHeaders(res, filePath) {
|
||||
if (filePath.endsWith('.css') || filePath.endsWith('.js')) {
|
||||
res.setHeader('Cache-Control', 'no-cache');
|
||||
}
|
||||
},
|
||||
}));
|
||||
|
||||
const docxUpload = multer({ storage: multer.memoryStorage(), limits: { fileSize: 20 * 1024 * 1024 } });
|
||||
|
||||
|
||||
Reference in new issue
Block a user