Skip to content

cache: honour unqualified no-cache response directive#4178

Merged
mcollina merged 4 commits intonodejs:mainfrom
alxndrsn:no-cache-response-directive
Apr 23, 2025
Merged

cache: honour unqualified no-cache response directive#4178
mcollina merged 4 commits intonodejs:mainfrom
alxndrsn:no-cache-response-directive

Conversation

@alxndrsn
Copy link
Copy Markdown
Contributor

Closes #4173

This relates to...

Rationale

https://datatracker.ietf.org/doc/html/rfc9111#name-no-cache-2:

The no-cache response directive, in its unqualified form (without an argument), indicates that the response MUST NOT be used to satisfy any other request without forwarding it for validation and receiving a successful response

Changes

Add additional check of no-cache directive of cached response when deciding if it needs revalidation.

Features

Na?

Bug Fixes

Breaking Changes and Deprecations

Changes caching behaviour.

Status

Comment thread test/no-cache.js Outdated
@alxndrsn alxndrsn marked this pull request as ready for review April 23, 2025 05:56
Comment thread test/interceptors/cache.js Outdated
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit c0e634d into nodejs:main Apr 23, 2025
28 of 31 checks passed
dhalbrook pushed a commit to dhalbrook/undici that referenced this pull request Apr 24, 2025
* cache: honour unqualified no-cache response directive

Closes nodejs#4173

* move test to interceptors/cache.js

* lint

* remove duplicate close()

---------

Co-authored-by: alxndrsn <alxndrsn>
dhalbrook pushed a commit to dhalbrook/undici that referenced this pull request Apr 24, 2025
@alxndrsn alxndrsn deleted the no-cache-response-directive branch April 25, 2025 06:26
This was referenced May 10, 2025
slagiewka pushed a commit to slagiewka/undici that referenced this pull request Feb 14, 2026
* cache: honour unqualified no-cache response directive

Closes nodejs#4173

* move test to interceptors/cache.js

* lint

* remove duplicate close()

---------

Co-authored-by: alxndrsn <alxndrsn>
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.

Cache prioritises cacheByDefault/max-age over no-cache response directive

4 participants