sourcelevel / faraday-http-cache

A Faraday middleware that respects HTTP cache
Other
343 stars 86 forks source link

If response is not_modified, why we need to store it again? #77

Closed mingleiwang closed 9 years ago

mingleiwang commented 9 years ago

I have a question about the code on https://github.com/plataformatec/faraday-http-cache/blob/master/lib/faraday/http_cache.rb#L247. So even if the response is not_modified, this line of code will store the response, right? Would this be extra step since the copy in the cache is still fresh?

lucasmazza commented 9 years ago

Because a 304 can update the headers of a stored response in the cache (there is a section in the RFC 7234 about this iirc).