volley cache return always null

In order to cache anything with Volley you need to have two things:
1) server allows you to cache it. it usually appears in a cache control tag in the HTTP header.
2) you save it or in this scenario you tell the Volly to save.
so i think your problem is in number one. that means the server dose not allow you to cache those files, in order to confirm my answer you can do one of these things:
  1. download this plug in (RESTClient) for mozilla and send your request and check the header file for cache control. if the server dose not allow you to cache you will see something like below image, notice cache control tag
enter image description here
  1. set break point in headerValue = headers.get("Cache-Control"); at HttpHeaderParse class and see whats going on when Volley wants to parse the cache control tag.

Comments

Popular posts from this blog

RUN JAVA PROJECT IN ANDROID STUDIO

Gradle DSL method not found: 'compile()'

Reverse string using recursion