Avoid cache when updating SW, for now

This commit is contained in:
Jake Archibald
2021-01-22 13:58:16 +00:00
parent 8e8b75684d
commit 1c7486056d

View File

@@ -84,14 +84,19 @@ export function cleanupCache(
); );
} }
function urlsToRequests(urls: string[]): Request[] {
// Using no-cache, as our hashing aren't updating properly right now.
return urls.map((url) => new Request(url, { cache: 'no-cache' }));
}
export async function cacheBasics(cacheName: string) { export async function cacheBasics(cacheName: string) {
const cache = await caches.open(cacheName); const cache = await caches.open(cacheName);
return cache.addAll(initial); return cache.addAll(urlsToRequests(initial));
} }
export async function cacheAdditionalProcessors(cacheName: string) { export async function cacheAdditionalProcessors(cacheName: string) {
const cache = await caches.open(cacheName); const cache = await caches.open(cacheName);
return cache.addAll(await theRest); return cache.addAll(urlsToRequests(await theRest));
} }
const nextMessageResolveMap = new Map<string, (() => void)[]>(); const nextMessageResolveMap = new Map<string, (() => void)[]>();