Question

In our Windows 8 application, we are using the IXMLHTTPRequest2 method to stream files over HTTP, files whose size can reach gigabytes. This all works perfectly, except for the fact that internally, WinRT has a caching system which stores all that is streamed over the call to IXMLHTTPRequest2 in the temporary internet cache. As we stream more and more files, the cache is never emptied and it just starts taking more and more space on disk, until the disk is full.

Optimally, we would like to disable this caching functionality entirely. Another option we could live with would be that the cached files would be removed after a short while (although we'd like to avoid having to browse the temporary internet cache and removing files manually).

We've tried adding the "Expires: 0" header to the server response, as well as disabling the caching directly inside IE (we thought this might have an influence on the call to IXMLHTTPRequest2), but to no avail.

Anyone has any thoughts on this?

I realize this question is similar to another one posted here, however, our problem has more to do with the space that is taken by the cache rather than by the "freshness" of the files.

EDIT: We have also found this post on the MSDN forums, where, according to a MSFT Moderator, "The system will also periodically cleans up the cache so you will not have to worry about running out of disk space", but that is not the case in our scenario.

Was it helpful?

Solution

According to this post on the MSDN forums, this isn't possible and is a known limitation with WinRT.

Sometimes the only answer is bad news. :-[

OTHER TIPS

As ildjarn noted, this seems to be unavoidable on Windows 8. But it looks like there might be a way to fix this for clients running Windows 8.1.

I haven't tried it myself, but I just noticed that there is now "IXMLHTTPRequest3" which extends "IXMLHTTPRequest2" with some new features: http://msdn.microsoft.com/en-us/library/windows/desktop/dn376398%28v=vs.85%29.aspx

The relevant feature is: XHR_PROP_NO_CACHE – Suppresses cache reads and writes for the HTTP request.

That sounds promising.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top