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