使用谷歌的凌空设置过期策略缓存 [英] Set expiration policy for cache using Google's Volley

查看:112
本文介绍了使用谷歌的凌空设置过期策略缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能修改对谷歌的凌空lib中的缓存过期策略?我相信你可以实现你自己的缓存,但有一个简单的方法来使用默认的实现做到这一点?

Is it possible to modify the expiration policy for the cache on Google's Volley lib? I believe you can implement your own cache, however is there an easy way to do this with the default implementation?

推荐答案

看来,目前的缓存过期被那么基本上你都留给服务器摆布的缓存的响应头进行控制的。在过期或最大年龄=将用于任何服务器返回。 我们将使用我们自己的高速缓存,如果我们需要自定义的到期策略...

It seems that currently the cache expiration is controlled solely by the "Cache" headers in the response so basically you are left to the mercy of the server. Whatever server returns in the "Expires" or "max-age=" that will be used. We will have to use our own cache if we need custom expiry policy...

这篇关于使用谷歌的凌空设置过期策略缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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