Sunday, 24 April 2016

How do I prevent caching of HTTP requests ?


By default, caching will be enabled.

You must use a URLConnection, rather than the URL.openStream() method, and explicitly specify that you do not want to cache the requests.

This is achieved by calling setUseCache method with a value of false.
URLConnection.setUseCaches(false);

No comments:

Post a Comment

Note: only a member of this blog may post a comment.