Open GoogleCodeExporter opened 9 years ago
There is more detailed documentation on HttpResponseCache here:
http://developer.android.com/reference/android/net/http/HttpResponseCache.html
A small note: enableHttpResponseCache() should be a static method added to
AndroidHttp, and we should probably also add Context context and long
httpCacheSize parameters. Also, since we are compiling against the latest
Android SDK version 4.1, we don't need to use reflection, though we should
still catch Exception so the method can be called on earlier versions of
Android without causing harm (though of course caching won't be abled if it is
not available).
Original comment by yan...@google.com
on 23 Sep 2012 at 6:56
We can also add a utility method to flush the cache to be called from onStop():
public static void flushHttpResponseCache() {
HttpResponseCache cache = HttpResponseCache.getInstalled();
if (cache != null) {
cache.flush();
}
}
(and again catch NoClassDefFoundException for compatibility with older Android
versions.
Original comment by yan...@google.com
on 23 Sep 2012 at 7:06
Check it out! There is a port of HttpResponseCache to be used on any Java
environment:
https://github.com/candrews/HttpResponseCache
It uses Apache License, Version 2.0, so it may be a good candidate for
inclusion.
Original comment by yan...@google.com
on 23 Sep 2012 at 7:10
Original comment by yan...@google.com
on 6 Oct 2012 at 1:37
Original issue reported on code.google.com by
yan...@google.com
on 23 Sep 2012 at 6:45