I am using HttpURLConnection for communication with server and using HttpResponseCache for caching, when server respond with 304 (HTTP_NOT_MODIFIED), i got empty body, but according to documentation of HttpURLConnection and HttpResponseCache, in case 304 HttpUrlConnection will fetch the response for the same URL in the cache. While the request for url is cached and i confirmed it. when url is called first time i get proper response (data) while after cached when i called url, Why i am getting empty body (no data).
Asked
Active
Viewed 1,008 times
1
-
are you instanciating this `HttpResponseCache`? or using defaults? – eduyayo Mar 17 '15 at 14:18
-
I am creating cache on start of application reference is this link http://developer.android.com/reference/android/net/http/HttpResponseCache.html – kashif181 Mar 17 '15 at 17:04
-
can i see the second request you´re doing? – eduyayo Mar 17 '15 at 17:16
-
@kashif181 we also encounter same problem. How did you fix this? Can you please help me out. – deepa May 11 '15 at 13:55
1 Answers
0
I fixed the issue by downloading volley library from official google code repository this is the link https://android.googlesource.com/platform/frameworks/volley/+/master.
Actually the volley source code available at github is customized and cause many issues (github link: https://github.com/mcxiaoke/android-volley), never download from that link.

kashif181
- 315
- 2
- 11