Skip to content

[Blazor] Update service-worker registration to prevent caching issues #44635

Closed
@javiercn

Description

@javiercn
    I think we should change our templates to do `serviceWorker.register('...', { updateViaCache: 'none' })`

Originally posted by @javiercn in #39252 (comment)

We might also want to modernize the service worker and use ES modules (now supported) instead of plain scripts as they allow dependencies to be stated explicitly.

The fix is to change the registration https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/wwwroot/index.html#L51

Metadata

Metadata

Assignees

Labels

Pillar: Dev ExperiencePriority:3Work that is nice to havearea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.feature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyfeature-pwaIssues related to building PWAs with Blazorhelp candidateIndicates that the issues may be a good fit for community to help with. Requires work from eng. team

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions