My app has a function where it takes user input and then calls HttpGet for the website (in this case, wiktionary). I then cut out the irrelevant parts and parse the rest with jsoup. One particular page is constantly returning an old version of the page source instead of the version that I updated a couple days ago. Is there any way to force it to fetch the new version instead? The app has no cache and unfortunately I have to use HttpGet instead of fetching with jsoup directly because of extraneous information that is too hard to separate without doing it the way I am. I have no way to edit the header of the webpage in question.
This is the relevant code:
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
ResponseHandler<String> resHandler = new BasicResponseHandler();
String page="";
Document doc = null;
try {
page = httpClient.execute(httpGet, resHandler);
doc = Jsoup.parse(page);
} catch (IOException e) {
e.printStackTrace();
}
Try to add a dynamic parameter to the url you want to fetch, like this:
http://myfancydomain.com/site.html?fetch=123456
The “123456” should be generated by a random number generator, alternatively you may want to use the current timestamp. The server recognizes this as a “new” request and will deliver the recent version of the site.