hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Moore <j...@apache.org>
Subject Re: Caching in http-core?
Date Wed, 19 Jun 2013 11:02:41 GMT
> On Sat, 2013-06-15 at 07:18 -0700, Sam Perman wrote:
> > I think it would be interesting to open those Apis up so the application
> could get cache entries for use in certain error cases.  (For example, my
> client app has detected the server is unavailable for some reason or I have
> crossed some throttling limit for requests to the backend... I could choose
> not to attempt a call to the backend and just return the cache entry
> instead.)

Hi Sam,

Many of the features you describe are already available from the
httpclient-based caching stack by modifying the requests that are sent. For
example, you can add 'Cache-Control: max-stale=31536000, only-if-cached' to
requests to prevent origin requests and get at any existing cache entries.
The caching stack also supports the stale-if-error (RFC5861) request
parameter, and will already return stale cache entries on networking errors
during revalidation.

Do those support your use cases?

The primary reason we've preferred to keep much of the caching APIs private
is to allow room for future refactorings without breaking API compatibility.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message