Skip to content

Commit

Permalink
Prevent caching the outdated browser message in a shared cache (#5076)
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli authored Aug 10, 2023
1 parent af06c6f commit 6c65e03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/5076.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prevent caching the outdated browser message in a shared cache. @davisagli
9 changes: 9 additions & 0 deletions src/server.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,15 @@ server.get('/*', (req, res) => {
const readCriticalCss =
config.settings.serverConfig.readCriticalCss || defaultReadCriticalCss;

// If we are showing an "old browser" warning,
// make sure it doesn't get cached in a shared cache
const browserdetect = store.getState().browserdetect;
if (config.settings.notSupportedBrowsers.includes(browserdetect?.name)) {
res.set({
'Cache-Control': 'private',
});
}

if (context.url) {
res.redirect(flattenToAppURL(context.url));
} else if (context.error_code) {
Expand Down

0 comments on commit 6c65e03

Please sign in to comment.