question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fix: JS and CSS cache issues in V2.3.0 and above

See original GitHub issue

🐛 Bug Report

Since JS and CSS files were included in the library we have had cache issues in production with new versions. Primarily CSS but it could also be JS related.

https://www.fluentui-blazor.net/WhatsNew#v2.3.0

For every other library imported we use asp-append-version="true" which prevents cache errors. Since JS and CSS are included we can not do that for Microsoft.Fast.Components.FluentUI. Tested that asp-append-version="true" works with both Blazor Server and Blazor WebAssembly. In the case of Blazor WebAssembly I got it to work in a ASP.NET Core Hosted project.

image

image

Affected files:

Microsoft.Fast.Components.FluentUI.lib.module.js Microsoft.Fast.Components.FluentUI.bundle.scp.css web-components.min.js

💁 Possible Solution

Use asp-append-version="true" or similar to appen hash.

If this is not possible then add the possibility for a user to include CSS and JS files themselves without them being automatically loaded. This is not the preferred solution though.

Issue Analytics

  • State:open
  • Created 3 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vnbaaijcommented, Aug 14, 2023

Although this will probably not solve all the problems with caching, we’ve added a version indicator to the included web components javascript file link in version 2.4.2

0reactions
Ogglascommented, Jun 18, 2023

@vnbaaij Can we keep it open to track the bug? I would rather see it open and blocked to show that the bug is present but can not be fixed now. It will also show as an open bug to the aspnetcore team if it remains open.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to force browsers to reload cached CSS and JS files?
With developer tools open, simply long click the refresh button and let go once you hover over "Empty Cache and Hard Reload". This...
Read more >
JavaScript and CSS cached and not updating ...
I was thinking that if it were just a caching problem, the old version of file should be show in "view source", shouldn't...
Read more >
Better way of dealing with JavaScript/CSS caching #1897
If we have a script and then change the contents of it, are we expected to rename the file each time the contents...
Read more >
How to avoid caching issue when using custom JavaScript ...
The solution is, to get rid of the starting "/" in your Name values. JS. SharePoint will automatically check, if the js file...
Read more >
What is Cache Busting? - KeyCDN Support
Cache busting solves browser caching issues by using a unique file version identifier to tell the browser that a new version of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found