Skip to content

Conversation

flakey5
Copy link
Member

@flakey5 flakey5 commented Nov 22, 2024

Closes #3853

This cleans up the cache interceptor file. This also makes the cache stores store the responses' cache control directives. This was the nicest way I could think of to implement stale-if-error and also sets it up nicely for if we ever allow for more cache control directive extensions.

@mcollina mcollina requested review from metcoder95 and ronag November 22, 2024 10:59
@metcoder95
Copy link
Member

types seems to be failing

@flakey5 flakey5 force-pushed the flakey5/20241120/3852 branch from c1bd909 to 835ade3 Compare November 22, 2024 16:34
@ronag
Copy link
Member

ronag commented Nov 23, 2024

@flakey5 can you rebase?

* @param {boolean} allowErrorStatusCodes
*/
constructor (callback, handler) {
constructor (callback, handler, allowErrorStatusCodes) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

For stale-if-error, error status codes when revalidating mean to use the stale response

@flakey5 flakey5 force-pushed the flakey5/20241120/3852 branch from 835ade3 to 45c0793 Compare November 24, 2024 03:02
@flakey5 flakey5 force-pushed the flakey5/20241120/3852 branch from 45c0793 to 10c87fd Compare November 25, 2024 15:40
Copy link
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.

There are plenty of merge errors

@flakey5 flakey5 force-pushed the flakey5/20241120/3852 branch from 10c87fd to 1f61576 Compare November 25, 2024 16:53
Copy link
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

@flakey5 flakey5 force-pushed the flakey5/20241120/3852 branch from 1f61576 to fa398ba Compare November 25, 2024 16:55
@flakey5 flakey5 requested a review from ronag November 25, 2024 17:24
Copy link
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 71b6b0b into nodejs:main Nov 25, 2024
37 checks passed
@github-actions github-actions bot mentioned this pull request Dec 3, 2024
This was referenced Dec 16, 2024
@github-actions github-actions bot mentioned this pull request Mar 12, 2025
@github-actions github-actions bot mentioned this pull request May 12, 2025
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: Implement stale-while-revalidate and stale-if-error

4 participants