0

I am working on an android application in which i want to use caching mechanism for httpurlrequest. I want to cache the response and want to use again for next request.

So, in android how to cache the response and how to use it next time when we do the same request.

Any working example would be great for me.

How to check whether response is from cache or from server?

How to check whether cache is available for the particular request.

PS: there is no any support of cache from server side. i.e sever doesn't send any 'Cache-Control' header field in response.

Thanks,

Milan
  • 11
  • 5
  • You can use `SharedPreferences` to store your response (xml/json etc)! – Muhammad Babar Oct 08 '15 at 06:52
  • @MuhammadBabar i cannot do the same, as i have too many api and i have to manage the same. So i want to cache via HttpResponseCache. – Milan Oct 08 '15 at 10:24
  • Any example of SharedPreferences ? – Milan Oct 08 '15 at 10:24
  • I don't know about `HttpResonseCache` After looking at this http://stackoverflow.com/questions/11584761/need-an-example-of-httpresponsecache-in-android i think this can serve your purpose! – Muhammad Babar Oct 08 '15 at 10:37
  • I have checked that but not working properly , or may be i am not using properly (as i ma new to android). Anyway thanks :) – Milan Oct 08 '15 at 11:57

0 Answers0