mozilla / connect-cachify

Express connect middleware to provide easy frontend caching for Node.js
Mozilla Public License 2.0
132 stars 21 forks source link

why strip out etag, last-modified headers? #28

Open jaredhirsch opened 11 years ago

jaredhirsch commented 11 years ago

Looking at this line:

https://github.com/mozilla/connect-cachify/blob/master/lib/connect-cachify.js#L106

I don't understand why we'd remove ETag or Last-Modified headers. My read of the RFC is that, if the max-age is in the future, the cached copy will be used; if the max-age has elapsed, the Last-Modified or ETag values could be used to send a conditional-GET, so the server could still save bandwidth by returning a 304.

Are there implementation bugs of which I'm unaware?

shane-tomlinson commented 11 years ago

@6a68 - +1 your suggestion is common practice that I think we should make use of. The URL will be updated if the resource changes, and a conditional GET will save a few bytes once the cache does expire.

ozten commented 11 years ago

My memory is super fuzzy, but I remember other middleware trying to manage cache headers causing us issues. I think the intent is if you use connect-cachify you want to disable other codepaths from trying to do cache control.