I have a React application that has been in production for quite a while. Monday evening we released a new update and now any of our users running Safari 16.x or older is unable to use the application they are presented with just a white page and chunk load errors.
enter image description here
If I have the users do a hard refresh (command + r) it loads the page, however on subsequent loads it still uses the cached version.
enter image description here
I thought I could fix this by adding headers for Cache-Control and then telling the users to hard refresh their browser.
const server = http.createServer((req, res) => {
console.log('Path : ', path.join(__dirname, 'build'));
return handler(req, res, {
public: path.join(__dirname, 'build'),
cleanUrls: true,
rewrites: [
{source: '/**', destination: '/index.html'},
],
headers: [
{
source: "/index.html",
headers: [{
key: "Cache-Control",
value: "no-cache"
}]
}],
directoryListing: false,
});
});
I’m obviously missing something here and any help would be greatly appreciated.
Captain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.