Picasso cache with various applied transformations

I use picasso to download some images from amazon s3 and apply the conversion in different areas of the Android application. Using debbuging, I notice that for every call with a different conversion size or image size, picasso will load it again and cache the converted image in memory. Is there a proper way to make picasso store the original image in the cache and then apply the transforms without loading it again and again? Network bandwidth is a problem for my user case.

+4
source share
1 answer

The original images will be saved to disk cache. Make sure your server sends the correct headers to ensure caching for any period of time you desire. When the second request is made and the image is already in the disk cache, it will be immediately returned.

By default, disk caching only works on Android 4.0 and later, as it was introduced into the embedded HTTP client. To cache at all API levels, include [OkHttp] [1] in your application. Picasso will automatically see OkHttp and use it. This will not only provide you with caching everywhere, but also the universal best HTTP client.

+5
source

All Articles