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

Add cache busting to server CSS resources #5414

Merged
merged 2 commits into from
Aug 17, 2023
Merged

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Aug 17, 2023

When using server resources the URL for the CSS resources does not change between different versions of Panel. This means that it will always use the same cached resources even when a deployed application updates the Panel version it runs on. To address this we add a query parameter to CSS resources containing the current Panel.js version, which will ensure that on each version upgrade the cache is busted.

@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Merging #5414 (6aaae3e) into main (c44fa17) will decrease coverage by 10.03%.
The diff coverage is 75.00%.

@@             Coverage Diff             @@
##             main    #5414       +/-   ##
===========================================
- Coverage   82.69%   72.67%   -10.03%     
===========================================
  Files         274      274               
  Lines       39897    39897               
===========================================
- Hits        32994    28996     -3998     
- Misses       6903    10901     +3998     
Flag Coverage Δ
ui-tests ?
unitexamples-tests 72.67% <75.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
panel/io/resources.py 87.26% <50.00%> (ø)
panel/tests/theme/test_base.py 100.00% <100.00%> (ø)

... and 60 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@philippjfr philippjfr merged commit b7b8bad into main Aug 17, 2023
11 of 15 checks passed
@philippjfr philippjfr deleted the server_cache_busting branch August 17, 2023 17:21
@MarcSkovMadsen
Copy link
Collaborator

Why is this only an issue for css files? What about js, svg etc files?

@philippjfr
Copy link
Member Author

Bundled files are mirrored from npm and reflect the full path which generally contains a version number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants