fix: add Cache-Control header to landing page
This commit is contained in:
parent
272c03c38d
commit
ec7af37214
1 changed files with 6 additions and 0 deletions
|
|
@ -257,6 +257,12 @@ app.use((req, res, next) => {
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Landing page (explicit route to set Cache-Control header)
|
||||||
|
app.get("/", (_req, res) => {
|
||||||
|
res.setHeader('Cache-Control', 'public, max-age=3600');
|
||||||
|
res.sendFile(path.join(__dirname, "../public/index.html"));
|
||||||
|
});
|
||||||
|
|
||||||
app.use(express.static(path.join(__dirname, "../public"), {
|
app.use(express.static(path.join(__dirname, "../public"), {
|
||||||
etag: true,
|
etag: true,
|
||||||
cacheControl: false,
|
cacheControl: false,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue