Picasso disk caching

别等时光非礼了梦想. 提交于 2020-01-02 05:01:07

问题


I am using Picasso to load images from a URL

Picasso.with(getApplicationContext()).load(product.getImageUrl()).into(imageView);

From what I can see this is going to the url everytime and not caching to disk. I need disk caching enabled

I have permissions

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

So its not a issue with disk. I think the issue is that the server is not sending back a cache param so HTTP Client is not caching.

How can I force Picasso use the disk cache at all times?


回答1:


Picasso doesn't have a disk cache. The library relies on HTTP clients to honor the semantics of the very well-defined caching headers for keeping things locally on disk.

Because of this fact, there is no way to force caching.



来源:https://stackoverflow.com/questions/20635506/picasso-disk-caching

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!