diff --git a/src/Components/Web.JS/dist/Release/blazor.server.js b/src/Components/Web.JS/dist/Release/blazor.server.js index b577692a322ea474cd7c39fa4045eded5afd479d..5a7cfd0de00e1c2694bf333a972ec50943bb2c06 100644 Binary files a/src/Components/Web.JS/dist/Release/blazor.server.js and b/src/Components/Web.JS/dist/Release/blazor.server.js differ diff --git a/src/Components/Web.JS/dist/Release/blazor.webassembly.js b/src/Components/Web.JS/dist/Release/blazor.webassembly.js index 48406a047af2fe1dc73626cf0b0015f8f69c33cd..eea1c77a59d0e5c8b65e3407c32ae11d1f38db98 100644 Binary files a/src/Components/Web.JS/dist/Release/blazor.webassembly.js and b/src/Components/Web.JS/dist/Release/blazor.webassembly.js differ diff --git a/src/Components/Web.JS/src/Platform/WebAssemblyResourceLoader.ts b/src/Components/Web.JS/src/Platform/WebAssemblyResourceLoader.ts index 5ab3364d5b7e10134dec2252d1e6f44b3fffadb0..f1e6690ee5ab52b591f5c0c3fc62b519c9bc8de8 100644 --- a/src/Components/Web.JS/src/Platform/WebAssemblyResourceLoader.ts +++ b/src/Components/Web.JS/src/Platform/WebAssemblyResourceLoader.ts @@ -85,7 +85,14 @@ export class WebAssemblyResourceLoader { const cacheKey = toAbsoluteUri(`${url}.${contentHash}`); this.usedCacheKeys[cacheKey] = true; - const cachedResponse = await cache.match(cacheKey); + let cachedResponse: Response | undefined; + try { + cachedResponse = await cache.match(cacheKey); + } catch { + // Be tolerant to errors reading from the cache. This is a guard for https://bugs.chromium.org/p/chromium/issues/detail?id=968444 where + // chromium browsers may sometimes throw when working with the cache. + } + if (cachedResponse) { // It's in the cache. const responseBytes = parseInt(cachedResponse.headers.get('content-length') || '0'); @@ -136,12 +143,19 @@ export class WebAssemblyResourceLoader { // Add to cache as a custom response object so we can track extra data such as responseBytes // We can't rely on the server sending content-length (ASP.NET Core doesn't by default) - await cache.put(cacheKey, new Response(responseData, { + const responseToCache = new Response(responseData, { headers: { 'content-type': response.headers.get('content-type') || '', 'content-length': (responseBytes || response.headers.get('content-length') || '').toString() } - })); + }); + + try { + await cache.put(cacheKey, responseToCache); + } catch { + // Be tolerant to errors writing to the cache. This is a guard for https://bugs.chromium.org/p/chromium/issues/detail?id=968444 where + // chromium browsers may sometimes throw when performing cache operations. + } } }