On a web page I have:
let response = await fetch(url, { cache: "no-store"});
Then in the service worker I have:
function handleFetch(event) {
console.log(event.request.cache) // Always prints 'reload', should be 'no-store'
}
self.addEventListener("fetch", handleFetch);
I require cache to be set to no-store not reload, i.e. the value it was set to. Chrome ignores the value and always changes it to reload. Am I doing something wrong or is this a case of Chrome inforcing its own value?
Further more to prove cache set correctly on the request I tried:
const init = { cache: "no-store"};
let request = new Request(url, init);
console.log(request.cache); // Prints 'no-store'
let request = new Request(url, init);