-
Notifications
You must be signed in to change notification settings - Fork 213
nginx: apply cache strategies to frontend and misc #984
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
Merged
Conversation
This file contains hidden or 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
This reverts commit 6b64319.
2 tasks
sadiqkhoja
approved these changes
Apr 25, 2025
alxndrsn
added a commit
that referenced
this pull request
Apr 28, 2025
Noted while working on #984 that: 1. these headers were not tested, and 2. cache header changes affected the application of content-security-policy headers This adds a default more restrictive CSP for routes which do not have other headers set.
This was referenced Apr 28, 2025
lognaturel
reviewed
May 13, 2025
| default "single-use"; | ||
| } | ||
| map $cache_strategy $cache_header_cache_control { | ||
| "immutable" "max-age=31536000"; |
Member
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.
Shouldn't this be public, max-age=31536000, immutable?
lognaturel
reviewed
May 13, 2025
| } | ||
| map $cache_strategy $cache_header_cache_control { | ||
| "immutable" "max-age=31536000"; | ||
| "revalidate" "no-cache"; |
Member
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 could add public here I think?
yanokwa
pushed a commit
to yanokwa/odk-central
that referenced
this pull request
Jun 11, 2025
yanokwa
pushed a commit
to yanokwa/odk-central
that referenced
this pull request
Jun 11, 2025
Noted while working on getodk#984 that: 1. these headers were not tested, and 2. cache header changes affected the application of content-security-policy headers This adds a default more restrictive CSP for routes which do not have other headers set.
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.
Closes #980
What has been done to verify that this works as intended?
New tests and existing tests.
Why is this the best possible solution? Were any other approaches considered?
if {}blocks solves a VERY surprising* number of footguns.* maybe not surprising to experienced nginx configurers, as there is plenty of documentation of
if's issues, e.g.How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Should mean less caching issues.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No.
Before submitting this PR, please make sure you have:
nextbranch OR only changed documentation/infrastructure (masteris stable and used in production)