Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
fix cache
Browse files Browse the repository at this point in the history
change html cache-control
  • Loading branch information
sapphi-red committed Dec 31, 2021
1 parent f27d455 commit 4409eba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/src/routes/static.js
Expand Up @@ -33,6 +33,12 @@ router.use(
lastModified: true,
maxAge: 604800 * 1000,
immutable: true,
setHeaders: (res, path) => {
if (serveStatic.mime.lookup(path) === 'text/html') {
// Custom Cache-Control for HTML files
res.setHeader('Cache-Control', 'public, max-age=300, s-maxage=180')
}
}
}),
);

Expand Down

0 comments on commit 4409eba

Please sign in to comment.