How to prevent Android from returning a cached response to my HTTP Request?

Append an unused parameter on the end of the URL:

HttpGet request = new HttpGet(url + "?unused=" + someRandomString());

where someRandomString() probably involves the current time.

It’s crude, but it’s pretty much guaranteed to work regardless of all the outside factors that can make a “proper” solution fail, like misconfigured or buggy proxies.

Leave a Comment