我想使用服务器缓存15分钟,所以我必须在setRequestProperty()中使用?使用服务器缓存15分钟
请帮助我..
这里是我的代码,我用..
private HttpURLConnection httpCon = null;
httpCon = (HttpURLConnection) httpUrl.openConnection();
httpCon.setRequestMethod("GET");
httpCon.setRequestProperty("Connection", "Keep-Alive");
httpCon.setRequestProperty("Pragma","public");
httpCon.setRequestProperty("Cache-Control","maxage=900");
httpCon.setUseCaches(true);
如果你下了ResponseCache路线,请注意bug http://code.google.com/p/android/issues/detail?id=14537 - 直到2.3之前,Android不会调用finalize()或close()在OutputStream – 2011-04-15 20:35:42
我想我需要为客户端和服务器设置中间HTTP缓存。 – 2011-04-18 07:06:33