Question

My Windows 8 Store App uses AppCache to cache web resources. For testing purposes, I need to be able to empty or invalidate the entire cache from a separate application. Simply purging my WinINET cache (e.g. from Fiddler) doesn't delete my application's files, because in Win8 each application gets an isolated cache.

I have found that I can empty the cache from within my application by creating a new cache and swapping the existing one with that, but I need to be able to do this from a separate application. Scouring MSDN, I haven't been able to come up with a method for this. Any ideas?

Was it helpful?

Solution

There's a couple of ways to do this. I think the easiest will be to use [Protocol Activation].

Make a protocol similar to clearmyapp://, then have your app, on activation by that protocol, clear the cache then close itself. Then you can create a shortcut on your desktop or a script that will call clearmyapp://.

The harder way would be to create a script that finds your app's folder in the Packages folder (in Users/Username/Local/Packages/PackageName), then finding the cache contents and deleting them.

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