title: apache httpclient and etag cache
body: <p>I'm using Apache HttpClient 4.3.1 and I'm trying to integrate etag validation cache.</p>
  
  <p>I've tried to "drop in" httpclient-cache CachingHttpClientBuilder instead of my usual HttpClientBuilder using <a href="https://hc.apache.org/httpcomponents-client-ga/tutorial/html/caching.html" rel="nofollow">instructions in here</a>, but that didn't seem to do any good. While tracing the execution, it seems like a response that has "etag" header (weak etag) isn't considered cache-able - and so isn't retained for the next cycle.</p>
  
  <p>Has anyone managed to use etag validation based cache with Apache HttpClient? I'm also open for alternative implementations.</p>
  
  <p>Notes:</p>
  
  <ol>
  <li>The server returns the first request with a weak etag header (W/"1234"). If the second request to the same URL has "If-None-Match=1234", the server returns 304. This is checked and working.</li>
  <li>The server does <em>not</em> send any other cache header (expires, etc).</li>
  <li>The whole setup works wonderfully when using a modern browser.</li>
  </ol>