我想使用服務器緩存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