RFC2616 policy enhancements

These commits address several limitations I encountered in using the HttpCache download middleware.

I think each commit can be merged independently of the others, so if you have issues with some of the patches, I hope you can merge any others that are OK.