是否可以修改 Google 的 Volley 库中缓存的过期策略?我相信您可以实现自己的缓存,但是有没有一种简单的方法可以使用默认实现来做到这一点?
最佳答案
无需编写自己的缓存实现。您可以更改方法 com.android.volley.toolbox.HttpHeaderParser.parseCacheHeaders(NetworkResponse response),忽略这些 header ,将 entry.softTtl 和 entry.ttl 字段设置为适合您的任何值,并在您的请求类中使用您的方法。
我对类似问题的回答中有一个示例 - Android Volley + JSONObjectRequest Caching
关于android - 使用 Google 的 Volley 设置缓存的过期策略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16783177/