```js const response = await next(); response.headers.set('Cache-Control', 'no-store'); return respo

const response = await next();
response.headers.set('Cache-Control', 'no-store');
return response;

^ This code will likely work in dev, but not in prod. In dev, headers from effective
fetch
requests can be mutable, whereas in prod they're not. There's various issues to resolve this (and I think it's mostly resolved now), but for safety you may want to clone the response before mutating the headers, like this:
const response = await next();
const newResponse = response.clone();
newResponse.headers.set('Cache-Control', 'no-store');
return newResponse;
Was this page helpful?