7digital/SevenDigital.Api.Wrapper — pull request #85 by AnthonySteele (2013-05-08 09:26:52+00:00)
Title: Refactor to caching in the API wrapper

The .com website currently introduces http caching by replacing `HttpClientWrapper : IHttpClient` with `CachingHttpClient : IHttpClient` which wraps it and caches responses as they come in.

This works ... most of the time, but if a response contains junk, it is cached before it is validated. As we have found this causes rare but severe problems. So this is the wrong place to put caching, it needs to be higher up the chain, after response validation.

I've given the api wrapper knowledge that there might be an `IResponseCache` which the client will have to implement and pass in if it wants caching. This is done in `IFluentApi.UsingCache(IResponseCache responseCache)` I think that this as a separate responsibility is better that as a http client.

This will be a breaking change for some (including .com) though if you know what to expect the re-write won't be too severe. ie. `CachingHttpClient` -> `ResponseCache`.

I think we should merge this - there are no performance penalties that I can see, the responsibilities are better separated and it might save us serious problems.
Also, does this obsolete `IFluentApi.UsingClient` ?