Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce issues with cached assets: Use fingerprinted static web assets #143

Open
Apollo3zehn opened this issue Aug 7, 2024 · 0 comments
Open
Assignees
Labels

Comments

@Apollo3zehn
Copy link
Member

If I understand this new feature correctly, it will add a fingerprint to the name of static assets like CSS files or Javascript files. This means that whenever the file content changes, the fingerprint will change too. And this means that the browser will not load an old version of the file from cache but load the up-to-date version from the web server (because the name has changed). At the same time, when the file content does not change, the name will not change and so the browser can cache the static assets for a very long time (forever in theory).

I think we don't need the WithStaticAssets line because we are using Blazor and there it should be enabled automatically accordings to the link below.

app.MapStaticAssets();

app.MapRazorPages()
+   .WithStaticAssets();

https://github.com/dotnet/core/blob/main/release-notes/9.0/preview/preview6/aspnetcore.md#fingerprinting-of-static-web-assets

@Apollo3zehn Apollo3zehn changed the title Reduce issues with cached assets: Use Fingerprinted static web assets Reduce issues with cached assets: Use fingerprinted static web assets Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants