I am developing against a proprietary library and are experiencing some issues with the cache of the HttpWebRequest. The library is using code equivalent to below to make requests:
var request = WebRequest.Create("http://example.com/") as HttpWebRequest;
request.CachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.CacheIfAvailable);
The external resource doesn't disallow caching although each response differs. Thus I am ending up getting the same response each time.
Is there any way to clear the contents of the HttpWebRequest cache? The right solution would be to fix the external source or perhaps change the cache policy, but neither is possible - hence the question.
Clearing the cache could have various impacts, so preferably the solution would be to invalidate the cache on a per resource basis.