guzzle/guzzle — pull request #247 by thewilkybarkid (2013-02-25 12:56:15+00:00)
Title: Cache debug headers

This adds in (optional) debug headers to the cache plugin. The parameters `cache.lookup` and `cache.hit` are set to `true` if a cached response is found and if it's acceptable respectively. The `X-Cache` and `X-Cache-Lookup` headers are then set with either 'HIT from GuzzleCache' or 'MISS from GuzzleCache'.

At the moment you can't (I think) see `X-Cache: MISS` and `X-Cache-Lookup: HIT` together, but a future PR to add in `stale-if-error` support (see RFC 5861) will cause this as it will require the option to store cached responses for longer than they're (normally) allowed to be used.

The second commit adds the `Via` header to requests and responses. I made it a seperate commit in case you didn't want to add it (it's a 'MUST' in the RFC, but doesn't exactly have any use apart from seeing that the request has gone through the plugin!).