Include max-age=0

Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
This commit is contained in:
Dominik Henneke
2021-03-05 16:02:23 +01:00
parent 393b623aef
commit 173ed924b7
2 changed files with 3 additions and 3 deletions
@@ -73,7 +73,7 @@ describe('createRouter', () => {
'returns %s with no-store Cache-Control header',
async file => {
const response = await request(app).get(file);
expect(response.header['cache-control']).toBe('no-store');
expect(response.header['cache-control']).toBe('no-store, max-age=0');
},
);
+2 -2
View File
@@ -103,7 +103,7 @@ export async function createRouter(
// staticFallbackHandler is configured.
// use `as any` since express uses mime v1 while we only have types for mime v2
if ((express.static.mime as any).lookup(path) === 'text/html') {
res.setHeader('Cache-Control', 'no-store');
res.setHeader('Cache-Control', 'no-store, max-age=0');
}
},
}),
@@ -114,7 +114,7 @@ export async function createRouter(
// The Cache-Control header instructs the browser to not cache the index.html since it might
// link to static assets from recently deployed versions. This is a workaround when no
// staticFallbackHandler is configured.
'cache-control': 'no-store',
'cache-control': 'no-store, max-age=0',
},
});
});