Skip to content

Conversation

@alxndrsn
Copy link
Contributor

@alxndrsn alxndrsn commented Apr 25, 2025

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?

* 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:

  • branched off and targeted the next branch OR only changed documentation/infrastructure (master is stable and used in production)
  • verified that any code or assets from external sources are properly credited in comments or that everything is internally sourced

@alxndrsn alxndrsn mentioned this pull request Apr 25, 2025
2 tasks
@alxndrsn alxndrsn marked this pull request as ready for review April 25, 2025 11:14
@alxndrsn alxndrsn requested a review from sadiqkhoja April 25, 2025 11:15
@alxndrsn alxndrsn merged commit 0f86f28 into getodk:next Apr 25, 2025
5 checks passed
@alxndrsn alxndrsn deleted the frontend-caching branch April 25, 2025 15:55
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.
default "single-use";
}
map $cache_strategy $cache_header_cache_control {
"immutable" "max-age=31536000";
Copy link
Member

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?

}
map $cache_strategy $cache_header_cache_control {
"immutable" "max-age=31536000";
"revalidate" "no-cache";
Copy link
Member

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants