|
From: Mark P. <msp...@gm...> - 2014-04-15 16:43:36
|
Good day. I am studying HTTP caching, and I have been helped a great deal by a close reading of the Resteasy CacheInterceptor client filter example: https://github.com/resteasy/Resteasy/blob/master/jaxrs/resteasy-client/src/main/java/org/jboss/resteasy/client/jaxrs/cache/CacheInterceptor.java I am still learning and could easily be missing something. But it seems to me that if 1) the client sets an If-None-Match header with an Etag value and 2) there is no local cache entry whatsoever, expired or not, as determined in the ClientRequestFilter implementation and 3) the server returns 304 by virtue of the If-None-Match header then the ClientResponseFilter implementation will try to fetch a response from cache when it is already determined that there is no such entry. Consequently, the client is left with no usable response available from cache or from the origin server. If I am correct, then if there is no cache entry as determined in the ClientRequestFilter implementation, is it appropriate to remove any If-None-Match -type headers before the request is sent? Thank you for your time as I try to understand this. -- Mark |