毕加索磁盘缓存 [英] Picasso disk caching

查看:81
本文介绍了毕加索磁盘缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的毕加索从URL加载图像

I am using Picasso to load images from a URL

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

这是我所看到的,这是要去的URL每次和不缓存到磁盘。我需要启用磁盘缓存

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

我有权限

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

所以它不是一个磁盘的问题。我认为这个问题是服务器不发送回缓存参数,以便HTTP客户端不缓存。

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?

推荐答案

毕加索没有一个磁盘缓存。图书馆依靠HTTP客户端兑现了非常明确的缓存标题的语义保持的东西在本地磁盘上。

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.

这篇关于毕加索磁盘缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆