The CacheStorage interface provides methods for clearing cache. Cache is cleared asynchronously, so when any of those method returns, it does not mean that all cache data is cleared completely.


To clear the cache and get a notification when cache data is cleared completely you should use the ClearCache(Action onCacheCleared) method.


The following code demonstrates how to clear cache and set up an action which will be run when the cache is cleared succesfully:


browser.CacheStorage.ClearCache(()=> 
{
    Console.WriteLine("The cache is cleared");
});