rack-cache
rack-cache copied to clipboard
Response code handling seems inconsistent with the spec
Hi,
The response code handling section links to http://tools.ietf.org/html/rfc2616#section-13.4, but seems inconsistent with it. This gem includes 404 in the whitelist of cacheable response codes, but the RFC does not.
The RFC also says that a response with a code outside the whitelist may still be cached if there's a cache header that allows it. Rack-Cache doesn't seem to honor the italicized part of that--e.g. a 204 response with an Expires header is never cached.
Are these departures intentional? Would you be amenable to a PR or two that changes them or makes them configurable?
Thanks!
I think caching 404s should be configurable, since I, for one, like having caching on for 404s that are known bad (like urls that I know don't exist and will never exist).
The if there's a cache header that allows it part seems more like a bug, and should probably just be fixed to comply with the RFC, but maybe I'm missing something.