Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit e8d8278

Browse files
Update with latest changes from dotnet/aspnetcore#64612
1 parent 59fa324 commit e8d8278

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

Home/wwwroot/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
<span class="dismiss">🗙</span>
3737
</div>
3838
<script src="_framework/blazor.webassembly.js"></script>
39-
<script>navigator.serviceWorker.register('service-worker.js');</script>
39+
<script>navigator.serviceWorker.register('service-worker.js', { updateViaCache: 'none' });</script>
4040
</body>
4141
</html>

Home/wwwroot/service-worker.published.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,13 @@ async function onFetch(event) {
5151
cachedResponse = await cache.match(request);
5252
}
5353

54-
// Fix for Cloudflare Pages, see: https://github.com/dotnet/aspnetcore/issues/33872
5554
if (cachedResponse && cachedResponse.redirected) {
56-
cachedResponse =
57-
new Response(cachedResponse.body,
58-
{
59-
headers: cachedResponse.headers,
60-
status: cachedResponse.status,
61-
statusText: cachedResponse.statusText
62-
});
55+
const clonedResponse = cachedResponse.clone();
56+
cachedResponse = new Response(clonedResponse.body, {
57+
headers: clonedResponse.headers,
58+
status: clonedResponse.status,
59+
statusText: clonedResponse.statusText
60+
});
6361
}
6462

6563
return cachedResponse || fetch(event.request);

0 commit comments

Comments
 (0)