faraday-http-cache
faraday-http-cache copied to clipboard
RFC 5861: HTTP Cache-Control Extensions for Stale Content
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.
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 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 are you still considering implementing this? (I see you dropped it from v2.0.0 milestone).
@tadas-s it's something I would to see implemented but I don't plan to work on this anytime soon