android - Android 中的 NSURLCache 替代方案

标签 android ios caching

我的 iOS 应用程序中有自定义缓存引擎。

AFURLCache* urlCache = [[[AFURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:@""] autorelease];
[NSURLCache setSharedURLCache:urlCache];    

现在想到安卓版。

那里的方法是什么?有没有办法设置 HTTP 请求的内部自定义处理?

最佳答案

NSURLCache 的 Android 替代品是 HttpResponseCache。

http://developer.android.com/reference/android/net/http/HttpResponseCache.html

该类支持HttpURLConnection和HttpsURLConnection; DefaultHttpClient 或 AndroidHttpClient 没有平台提供的缓存。

关于android - Android 中的 NSURLCache 替代方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12613390/

相关文章:

android - 应用程序支持后台播放视频、cordova 问题、google play 拒绝应用程序

Android:扩展一个通过反射获取的隐藏类

ios - 缺少应用程序加载器错误图标 57x57、72x72

html - CSS文件的浏览器缓存

android - 如何删除firebase android中的子节点?

android - 在Android上使用XStream时如何注释order字段?

ios - 图像未根据方向变化调整大小

iOS 将文件导入我的应用程序

php - 在Laravel中使用Redis缓存图像吗?

ruby-on-rails - pjax vs turbolinks vs cache_digests 以提高 rails 速度?