Prior to this change, rack-cache would always strip any If-None-Match and/or If-Modified-Since headers from the request before passing along to the backend in an attempt to retrieve a response to put in the cache (304 responses are not currently cacheable). This approach falls down when the response includes a 'Cache-Control: private' header (Rails default) because the response cannot be cached but will also never allow for client initiated validation. The downside to this change is that the cache will fill in more slowly when clients make conditional requests for public resources; it won't fill in until a non-conditional request is received. The upside is that validation works for non-cacheable private responses.
This is for consistency with the other stores, which all rely on the object being marshal-able. It should also address a severe issue with the heap store caused by the request env hash being modified in place. See the following for more details: rails/rails#545
This should close #27. Before we assumed that any env element with an all caps + underscore key was marshallable. Now we also check that the value is actually a string.
This should hopefully fix #23 -- Rack::Lock and other middleware rely on the body being closed to signal the end of the request cycle.