Skip to content

Commit

Permalink
fix: make sure _next/static is served as immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
znarf committed Jan 21, 2020
1 parent 8543e01 commit 61c545e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/routes.js
Expand Up @@ -32,6 +32,11 @@ module.exports = (server, app) => {
next();
});

server.use('/_next/static', (req, res, next) => {
res.set('Cache-Control', 'public, max-age=31536000, immutable');
next();
});

server.use((req, res, next) => {
if (req.query.language && intl.languages.includes(req.query.language) && req.query.set) {
res.cookie('language', req.language);
Expand Down

0 comments on commit 61c545e

Please sign in to comment.