faraday-http-cache icon indicating copy to clipboard operation
faraday-http-cache copied to clipboard

RFC 5861: HTTP Cache-Control Extensions for Stale Content

Open lucasmazza opened this issue 8 years ago • 4 comments

Would be interesting to experiment with the RFC 5861 to implement support for stale-if-error and stale-while-revalidate extensions.

stale-if-error might be an easy one but I wonder how would be the best approach for the background revalidation on stale-while-revalidate - maybe a soft dependency on concurrent-ruby as an async abstraction to perform the revalidation request on the background.

lucasmazza avatar Apr 17 '16 20:04 lucasmazza

We'd be interested in stale-if-error as well, as our current resilience layer is sort of ad-hoc. However, would max-stale not suffice?

dasch avatar Apr 26 '16 09:04 dasch

@dasch I guess it could cover a few similar use cases, but those directives have a few different caveats - max-stale can be used by clients who know that they can use the cached responses for longer than the server recommends, while stale-if-error would only be in play if a request fails.

lucasmazza avatar Apr 29 '16 17:04 lucasmazza

@lucasmazza are you still considering implementing this? (I see you dropped it from v2.0.0 milestone).

tadas-s avatar Jan 13 '17 17:01 tadas-s

@tadas-s it's something I would to see implemented but I don't plan to work on this anytime soon

lucasmazza avatar Jan 13 '17 18:01 lucasmazza