0
votes

Is it possible to serve stale data while OKHttpCache is revalidating data, if any Http request comes in meanwhile. We are caching web service responses to improve performance for our clients but in case when cache data gets invalid, user gets a very delayed response as cache passes the request directly to web services and revalidate itself and passes the response to client.

We want cache to serve stale data to client and relvalidate in other thread. I know it can be done on Apache Cache but is it possible with OKHttpCache as well?

1

1 Answers

0
votes

Its a feature we want to build. In the interim, you might be able to fake it with cache headers in the request that avoid the network: Cache-Control: only-if-cached.