cache: fix stale-while-revalidate and stale-if-error#3865
Merged
mcollina merged 4 commits intonodejs:mainfrom Nov 25, 2024
Merged
cache: fix stale-while-revalidate and stale-if-error#3865mcollina merged 4 commits intonodejs:mainfrom
mcollina merged 4 commits intonodejs:mainfrom
Conversation
ronag
approved these changes
Nov 22, 2024
metcoder95
approved these changes
Nov 22, 2024
Member
|
types seems to be failing |
c1bd909 to
835ade3
Compare
Member
|
@flakey5 can you rebase? |
ronag
reviewed
Nov 23, 2024
| * @param {boolean} allowErrorStatusCodes | ||
| */ | ||
| constructor (callback, handler) { | ||
| constructor (callback, handler, allowErrorStatusCodes) { |
Member
Author
There was a problem hiding this comment.
For stale-if-error, error status codes when revalidating mean to use the stale response
835ade3 to
45c0793
Compare
metcoder95
approved these changes
Nov 24, 2024
45c0793 to
10c87fd
Compare
mcollina
requested changes
Nov 25, 2024
Member
mcollina
left a comment
There was a problem hiding this comment.
There are plenty of merge errors
10c87fd to
1f61576
Compare
Closes nodejs#3853 Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com>
1f61576 to
fa398ba
Compare
mcollina
reviewed
Nov 25, 2024
Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com>
Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com>
Merged
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.