The service I am using to obtain images, like many such sites does not have a cache control header indicating how long the image should be cached. Volley uses an http cache control header by default to decide how long to cache images on disk. How could I override this default behavior and keep such images for a set period of time?
Thanks
I needed to change the default caching strategy to a "cache all" policy, without taking into account the HTTP headers.
You want to cache for a set period of time. There are several ways you can do this, since there are many places in the code that "touch" the network response. I suggest an edit to the
HttpHeaderParser
(parseCacheHeaders
method at line 39):and another to
Cache.Entry
class:where
GLOBAL_TTL
is a constant representing the time you want each image to live in the cache.