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

Cache bust some frequently updated assets #3042

Merged
merged 3 commits into from
Oct 13, 2021

Conversation

mitchray
Copy link
Member

This uses the MD5 hash of a file to create a unique cached version, to avoid 'just clear your browser cache' issues

  • Reference a cached version of asset if it exists, otherwise create cached version and reference it, or fallback to original file
  • Added 'Clear Assets Cache' option to Ampache Debug page
  • Change paths in CSS to be web root relative to account for different physical locations of original and cached CSS file

Not sure if I should also clear the asset cache during clean_catalog() just so its periodically cleared?

@codeclimate
Copy link

codeclimate bot commented Oct 13, 2021

Code Climate has analyzed commit c4af2dd and detected 22 issues on this pull request.

Here's the issue category breakdown:

Category Count
Bug Risk 20
Security 1
Style 1

Note: there are 20 critical issues.

View more on Code Climate.

@lachlan-00
Copy link
Member

could do it as part of the update function in AutoUpdate::update_files?
image

that would then clear it after an update

@mitchray
Copy link
Member Author

Sweet, added!

@lachlan-00 lachlan-00 merged commit 88797f8 into ampache:develop Oct 13, 2021
@lachlan-00
Copy link
Member

nice, worked a treat

@mitchray mitchray deleted the feature/asset-cache branch October 13, 2021 05:18
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