r-maxage is a new directive that takes precendence over s-maxage and max-age. While s-maxage is honored by any shared cache, r-maxage is only taken into account by reverse proxy caches, and thus ignored by proxy and private caches. Setting r-maxage allows applications to ensure the response is only cached by their reverse cache, and thus are able in particular to purge the cache knowing that it will not remain stale in intermediate proxy servers.
By default, this will strip the Set-Cookie response header before storing a cacheable response.
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.
Need to pull together a strategy for handling encodings. The binary file tests are failing for dalli without this change because cache.get appears is returning a utf-8 string when that's the external encoding. That actually seems like correct behavior but the disk store is setup for binary only so I'm inclined to roll with it as the default behavior for now.
I hate this shit so bad. Apparently, I was still under the impression that I was clever when these tests were written. All of this needs moved to simple test/unit + assert style but I don't have time right now so bacon is going to have to do. This should at least let us run the testsuite under Ruby 1.9.2 which is currently blocking all kinds of progress.