Hi,

I am trying to make RFC5861-style background validation work in my client
and it does not seem to work. Did I miss something in the client code or
server headers (see below)?

Thanks!

Thomas


ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager();
cm.setMaxTotal(1000);
cm.setDefaultMaxPerRoute(100);
HttpClient httpClient = new DefaultHttpClient(cm);
CacheConfig cacheConfig = new CacheConfig();
cacheConfig.setMaxObjectSizeBytes(1000000);
cacheConfig.setRevalidationQueueSize(1000);
cacheConfig.setAsynchronousWorkersCore(100);
cacheConfig.setAsynchronousWorkersMax(1000);
cacheConfig.setAsynchronousWorkerIdleLifetimeSecs(100);
cacheConfig.setSharedCache(true);
cachingClient = new CachingHttpClient(httpClient,
new EhcacheHttpCacheStorage(httpCache),
cacheConfig);

HttpGet httpget = new HttpGet(uri);

try {
HttpResponse response = cachingClient
.execute(httpget, localContext);
HttpEntity entity = response.getEntity();
entity.getContent();

EntityUtils.consume(entity);

} catch (Exception e) {
httpget.abort();
}



DEBUG: org.apache.http.wire - >> "GET /repository/details HTTP/1.1[\r][\n]"
DEBUG: org.apache.http.wire - >> "Via: 1.1 localhost
(Apache-HttpClient/4.1.2 (cache))[\r][\n]"
DEBUG: org.apache.http.wire - >> "If-None-Match:
"3-bc1a9339e9de45baefb04f8a66013365"[\r][\n]"
DEBUG: org.apache.http.wire - >> "Host: localhost[\r][\n]"
DEBUG: org.apache.http.wire - >> "Connection: Keep-Alive[\r][\n]"
DEBUG: org.apache.http.wire - >> "User-Agent: Apache-HttpClient/4.1.2 (java
1.5)[\r][\n]"
DEBUG: org.apache.http.wire - >> "[\r][\n]"
DEBUG: org.apache.http.wire - << "HTTP/1.1 304 Not Modified[\r][\n]"
DEBUG: org.apache.http.wire - << "Date: Wed, 02 Nov 2011 23:53:15
GMT[\r][\n]"
DEBUG: org.apache.http.wire - << "Connection: Keep-Alive[\r][\n]"
DEBUG: org.apache.http.wire - << "Keep-Alive: timeout=5, max=79[\r][\n]"
DEBUG: org.apache.http.wire - << "Etag:
"3-bc1a9339e9de45baefb04f8a66013365"[\r][\n]"
DEBUG: org.apache.http.wire - << "Cache-Control: public,
stale-if-error=43200[\r][\n]"
DEBUG: org.apache.http.wire - << "[\r][\n]"

Reply via email to