senchalabs/connect — pull request #553 by cweider (2012-04-28 05:59:24+00:00)
Title: Cache Improvement

Some improvements to StaticCache - mostly maintenance.

* Adjust cache key to include the URL query. *Surprised that there’s no bug for this cache-busting scenario.*
* Make assumption of 200 response more obvious (made upon storing in the cache vs on retrieval). *This assumption should probably be removed altogether.*
* Simplify respond-from-cache decision making. It was a bit hard to follow, now it’s all in one block.
* Restrict cases when `StaticCache` interferes with request: only on `GET` and `HEAD` and when no ranges are requested. *This could probably use more restriction.*

The last commit is unfortunately ugly, so it may be worth dropping. It is more relevant to refactoring this for general (non-static) use.