This package deals with making sure lib.module.js files are clear when a new deployment is made or when you update them
For more information on javascript initializers: (more info here)
- Add the nuget package in your Client (wasm) AND your Server (if using Blazor wasm hosted) projects.
dotnet add package BlazorCacheBuster
- Publish your app in Release mode and test it!
dotnet publish Client\Sample.csproj -c Release
Nuget package page can be found here.
The following options allow you to customize the tasks executed by this package.
If you want to use a different query string for busting the cache, for example a specific version, add the following property in the published project's .csproj file (Server project if using Blazor hosted).
<!-- By default it will be a new guid for every publish. -->
<CacheId>1</CacheId>
You can disable the cache busting add the following property in the published project's .csproj file (Server project if using Blazor hosted).
<DisableCacheBusting>true</DisableCacheBusting>
TODO: Be able to cache bust scripts/styles in index.html Automatically append the version of the assembly as query string