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 support for responses without cache-control: public #3852

Closed
3 tasks
mcollina opened this issue Nov 20, 2024 · 0 comments · Fixed by #3842
Closed
3 tasks

Add cache support for responses without cache-control: public #3852

mcollina opened this issue Nov 20, 2024 · 0 comments · Fixed by #3842

Comments

@mcollina
Copy link
Member

According to https://www.rfc-editor.org/rfc/rfc9111.html#response.cacheability, it's possible to cache responses if Cache-Control: public is not present.

Going through that list (non exhaustively):

  • Support caching data with Cache-Control: private, behind an option (disabled by default)
  • Support Expires header
  • Caching responses that are not explicitly uncacheable, behind an option (disabled by default)

On that latter point:

Note that, in normal operation, some caches will not store a response that has neither a cache validator nor an explicit expiration time, as such responses are not usually useful to store. However, caches are not prohibited from storing such responses.

This might be useful for some application.

flakey5 added a commit to flakey5/undici that referenced this issue Nov 22, 2024
flakey5 added a commit to flakey5/undici that referenced this issue Nov 24, 2024
flakey5 added a commit to flakey5/undici that referenced this issue Nov 24, 2024
flakey5 added a commit to flakey5/undici that referenced this issue Nov 25, 2024
flakey5 added a commit to flakey5/undici that referenced this issue Nov 26, 2024
flakey5 added a commit to flakey5/undici that referenced this issue Nov 26, 2024
mcollina pushed a commit that referenced this issue Nov 26, 2024
* test: add cache testing suite

Closes #3852
Closes #3869

Signed-off-by: flakey5 <[email protected]>

* some cleanup

Signed-off-by: flakey5 <[email protected]>

* docs

Signed-off-by: flakey5 <[email protected]>

* Update test/cache-interceptor/cache-tests.mjs

Co-authored-by: Khafra <[email protected]>

* fetch

Signed-off-by: flakey5 <[email protected]>

---------

Signed-off-by: flakey5 <[email protected]>
Co-authored-by: Khafra <[email protected]>
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 a pull request may close this issue.

1 participant