lox / httpcache

An RFC7234 compliant golang http.Handler for caching HTTP responses
MIT License
264 stars 28 forks source link

httpcache makes two requests #29

Open hauva69 opened 8 years ago

hauva69 commented 8 years ago

While using httpcache in an environment where we used a ReverseProxy implementation which supports several upstream hosts I noticed that the cache makes two requests to the upstream when cache has expired.

Fixing outreq in pull request Use outreq helped me, but two requests are still problematic.

Also, we think that it is a bit strange that the code uses only differences in the headers to check whether the cache should be updated. If we respond with exactly the same headers, the cache does not seem to get updated at all.

lox commented 7 years ago

Hi @hauva69, apologies for the delayed response. My dev time on httpcache has been on the back-burner, but working on some improvements. Are you still using httpcache? Interested in how you would expect the cache invalidation should work.