diff --git a/plugins/app-backend/src/service/router.test.ts b/plugins/app-backend/src/service/router.test.ts index 1a6fee01a0..cabe4c59b9 100644 --- a/plugins/app-backend/src/service/router.test.ts +++ b/plugins/app-backend/src/service/router.test.ts @@ -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'); }, ); diff --git a/plugins/app-backend/src/service/router.ts b/plugins/app-backend/src/service/router.ts index ba407d9ef8..fec300bace 100644 --- a/plugins/app-backend/src/service/router.ts +++ b/plugins/app-backend/src/service/router.ts @@ -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', }, }); });