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 headers to responses #1390

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alxndrsn
Copy link
Contributor

@alxndrsn alxndrsn commented Feb 8, 2025

Closes getodk/central#662

What has been done to verify that this works as intended?

Added tests.

Why is this the best possible solution? Were any other approaches considered?

It seems simple.

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 prevent future caching surprises.

Does this change require updates to the API documentation? If so, please update docs/api.yaml as part of this PR.

No? "cache" is not currently mentioned in docs/

Before submitting this PR, please make sure you have:

  • run make test and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code from external sources are properly credited in comments or that everything is internally sourced

@alxndrsn alxndrsn requested a review from lognaturel February 8, 2025 09:01
@alxndrsn alxndrsn changed the title Add cache headers Add cache headers to responses Feb 8, 2025
@@ -58,6 +58,17 @@ module.exports = (container) => {
const cookieParser = require('cookie-parser');
service.use(cookieParser());

service.use((req, res, next) => {
// TODO only set for safe methods?
// TODO only set for authenticated requests?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these todos for a reviewer to consider? Something you're still thinking about?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I think I'd be happy deleting them both, but I'd be interested in a review of that.

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

Successfully merging this pull request may close these issues.

Cloudflare caches Entity Lists for longer than expected
2 participants