Search code examples
androidcachingofflinepicassoandroid-lru-cache

picasso doesn't cache for the first load but it's ok for the second time


I implemented a routine which saves data from a json into database and after that if user gets offline, he can see all data. but picasso doesn't load the images after the first run. but when i run the application twice in online mode, after that picasso can load the images from cache in offline mode. (it should cache images on the first run but it's not working)

appreciate any suggestion


Solution

  • https://stackoverflow.com/a/23281195/3664628

    Picasso doesn't have a disk cache. It delegates to whatever HTTP client you are using for that functionality (relying on HTTP cache semantics for cache control). Because of this, the behavior you seek comes for free...