-
Notifications
You must be signed in to change notification settings - Fork 548
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
cache: fix stale-while-revalidate and stale-if-error #3865
Conversation
types seems to be failing |
c1bd909
to
835ade3
Compare
@flakey5 can you rebase? |
*/ | ||
constructor (callback, handler) { | ||
constructor (callback, handler, allowErrorStatusCodes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary?
There was a problem hiding this comment.
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
835ade3
to
45c0793
Compare
45c0793
to
10c87fd
Compare
There was a problem hiding this 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
10c87fd
to
1f61576
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Closes nodejs#3853 Signed-off-by: flakey5 <[email protected]>
1f61576
to
fa398ba
Compare
Signed-off-by: flakey5 <[email protected]>
Signed-off-by: flakey5 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
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.