return chain.execute(request, context);
}
public HttpResponse executeGET(final HttpUriRequest request, final HttpContext context, final MechanizeFilter chain) {
String uri = request.getURI().toString();
CacheEntry previous = cache.get(uri);
if (previous!=null && previous.isValid())
return previous.getResponse();
if (previous!=null)
previous.prepareConditionalGet(request);
HttpResponse response = chain.execute(request, context); // call the chain
if (response.getStatusLine().getStatusCode()==304) // not modified
return previous.updateCacheValues(response).getResponse();
CacheEntry maybe = generateCacheEntry(request, response);
if (maybe.isCacheable())
store(uri, previous, maybe);
return response;
}