Skip to content

Browser Cache Issue: _framework/dotnet.js Not Versioned for Cache BustingΒ #993

@clairernovotny

Description

@clairernovotny

Current behavior πŸ›

When upgrading Uno Platform WASM apps between .NET versions (e.g., .NET 9.0.11 β†’ .NET 10.0.100 β†’ .NET 10.0.102), browsers serve cached _framework/dotnet.js and uno-bootstrap.js instead of fetching new versions. This causes runtime initialization failures because the cached loader is incompatible with the new runtime.

Expected behavior 🎯

Proper version of dotnet.js loaded.

How to reproduce it (as minimally and precisely as possible) πŸ”¬

Build and debug a .NET 9 project and see it load localhost:5000/_framework/dotnet.js. Switch tfm's to .NET 10 and debug again. Theres' various boot issues (like it looking for a blazor.boot.js), indicating that the browser used a cached version of dotnet.js (as it's at the same path).

Workaround πŸ› οΈ

No response

Renderer 🎨

  • Skia
  • Native

Affected platforms πŸ“±πŸ’»πŸ–₯️

No response

Uno.Sdk version (and other relevant versions) πŸ“¦

6.4.0-dev.50

IDE version πŸ§‘β€πŸ’»

No response

Anything else we need to know? πŸ’¬

Perhaps the .NET Runtime version it's build to target can be used in the ShellTask as a cache-busting parameter. Index.html loads uno-bootstrapper.js, and that would need to have a cache-bust query string as well, perhaps based on a hash of the files it references in its dependency chain. The goal should be for the browser to cache and use the right version of dotnet.js, as it is a larger file. It just needs to be the right version.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions