hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: HttpGet seems to be cached - Response do not change
Date Mon, 21 Sep 2009 11:20:57 GMT
On Sun, 2009-09-20 at 23:05 +0200, mz8lenvp05gyb78 wrote:
> Hello everyone,
> 
> i got a problem with the HttpClient Component. I poll a website every 5 
> minutes to track the changes of it. But when it changes the reponse 
> string does not change. I'm using a class which implements the runnable 
> interface and use ScheduledThreadPoolExecutor for executing the thread 
> every specified time. I'm ignoring all cookies with a self written 
> CookieSpecFactory.
> 
> client = new DefaultHttpClient();
> ((DefaultHttpClient) 
> client).getCookieSpecs().register(IgnoringSpecFactory.IGNORE, new 
> IgnoringSpecFactory());
> client.getParams().setParameter("http.protocol.cookie-policy", 
> IgnoringSpecFactory.IGNORE);
> 
> Due a debug session i know:
> 
>     * The Runnable instance is the same at every pass.
>     * The HttpClient instnace is the same ar every pass.
> 
> The only problem is, that the content do not change, although the 
> website changes. The rest of the code in the run-Mehthod:
> 
> HttpGet get = new HttpGet(url);
> ResponseHandler<String> handle = new BasicResponseHandler();
> String response = client.execute(get, handle);
> client.getConnectionManager().closeExpiredConnections();
> 
> I'm looking forward for some hints.
> 
> Regards,
> Benjamin
> 

Benjamin,

HttpClient does not cache content. Please turn on the wire logging in
order to see the content of HTTP messages that get sent across the wire,
as described in this document:

http://hc.apache.org/httpcomponents-client/logging.html

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message