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

An attempt at conservative default cache-control headers #7587

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

jonasfj
Copy link
Member

@jonasfj jonasfj commented Mar 25, 2024

public max-age=10min for all responses where:

  • Request is GET
  • Response is HTML
  • Response is 200
  • Request has no authentication, xsrf-token or cookies
  • Response handler didn't explicitly set a different Cache-Control header

public max-age=30min for all responses where:

  • Request is GET
  • Request is handled by PubApi (ie. this is /api/)
  • Response is 200
  • Request has no authentication, xsrf-token or cookies
  • Response handler didn't explicitly set a different Cache-Control header

Also made a few exceptions:

  • set private on responses for /consent flow.
  • set public max-age=10min on screenshots
  • set public max-age=10min on version listing API /api/packages/<package>

@jonasfj jonasfj requested review from isoos and sigurdm March 25, 2024 09:15
@isoos
Copy link
Collaborator

isoos commented Mar 25, 2024

public max-age=30min

shouldn't we start with a lower default and increase it in a subsequent deployment?

@jonasfj jonasfj merged commit b895f98 into dart-lang:master Mar 25, 2024
30 of 31 checks passed
@jonasfj jonasfj deleted the conservative-default-cache-control branch March 25, 2024 10:34
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