-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Browser side Azure static assets caching #56
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cooper667
requested review from
ChasNelson1990,
jonathansberry and
mixmixmix
December 31, 2024 10:57
ChasNelson1990
approved these changes
Jan 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've used staging a lot to test the WAF and nothing seems broken!
🚀 [bumpr] Bumped! New version:v3.3.0 Changes:v3.2.0...v3.3.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
By default, CKAN caches badly The settings it give us for caching are fairly blunt, but we can set some things at the CDN level. It sets
must-revalidate
on things, which according to the spec:And
no-cache
, which doesn't technically mean don't cache, but apparently some browsers DO interpret it as thatSo we probably don't need that on...fonts etc.
This PR allows static assets to be cached browser side. This helps a lot when navigating pages and generally using the site as it makes the user experience quicker and removes some load from the server. We cache for a long time, and invalidation is handled by hashes in the names of the assets (we may want to consider how we handle images if we have some that change frequently)
The list of extensions cached is:
We likely want to do similar with AWS/Cloudflare
The next step is caching in our CDNs too to help first load on these requests, this requires some CKAN config tho.
Testing (delete if not applicable)
Deployed on AfroStaging
Checklist
Put an
x
in the boxes that apply to this pull request (you can also fill these out after opening the pull request).You may not need to check all boxes.