Reputation: 412
I have cached the response from the server based on the headers sent by the server . The value of max age is 180 s .From what I understand if any request is made for the same url after 180 s volley frameworks replaces the cache with the updated version of the data from the server . I want to display the cached data when the network connectivity is not present . How can I implement this using android volley???
Upvotes: 1
Views: 552
Reputation: 4218
in this case, hadle the network error and when it happens, get the data from the cache directly with mQueue.getCache().get(request.getCacheKey()), it will return the data if it's in the cache even if it's expired.
Upvotes: 2