dotnet/aspnetcore

Blazor initializer scripts are cached when they clearly have been changed-

Nickztar opened this issue · 2 comments

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

After upgrading to NET 7 and also upgrading some of my packages. A package that had a initializer script had some major changes and was still cached by the browser. This caused it to throw a exception on startup since the script is supposed to take care of the dll initialization.

I am not sure if this is something that blazor should be in charge of. Not really sure how blazor should be able to validate the integrity/change.

Expected Behavior

I expected that blazor would take care of validating that the SHA included in the blazor.boot.json is the one that is loaded into the page.

Steps To Reproduce

Turn on browser cache.
Load the page.
Change the lib.module.js file.
Load the page again and see that the lib.module.js file has not changed.

Exceptions (if any)

image

.NET Version

7.0.0

Anything else?

image
image

Thanks for contacting us. It looks like the server sends the ETag header correctly, which is what we rely on to invalidate cached content. The fact that this doesn't work for you is interesting. Can you publish your app somewhere so that we can try it out? (publicly accessible please).