DotNetBrowser  1.14
Public Member Functions | List of all members
DotNetBrowser.CacheStorage Interface Reference

The system for cache handling. The persistent cache are stored in the Browser data directory in Cache folder. By default all Browsers use predefined data directory. You can find out where this directory is located using the BrowserPreferences.GetDefaultChromiumDir() method. More...

Public Member Functions

void ClearCache ()
 Clears cache data in Browser's user data directory. This method clears cache asynchronously, so when this method returns there's no guaranty that all cache data is cleared completely. To clear cache and get notification when cache data is cleared completely use the clearCache(Callback) method. More...
 
void ClearCache (Action onCacheCleared)
 Clears cache data in Browser's user data directory and notifies when cache is successfully cleared via passed onCacheCleared . More...
 

Detailed Description

The system for cache handling. The persistent cache are stored in the Browser data directory in Cache folder. By default all Browsers use predefined data directory. You can find out where this directory is located using the BrowserPreferences.GetDefaultChromiumDir() method.

So, if Browser A and B have the same data directory, then they will access the cache of each other.

If you need to configure each Browser to use unique cache storage which is not accessible for other Browser instances, you need to provide unique user data directory for each Browser instance. The user data directory path can be provided via configured BrowserContext.BrowserContext(BrowserContextParams) object that must be passed into the BrowserFactory.Create(BrowserContext) factory method.

Member Function Documentation

void DotNetBrowser.CacheStorage.ClearCache ( )

Clears cache data in Browser's user data directory. This method clears cache asynchronously, so when this method returns there's no guaranty that all cache data is cleared completely. To clear cache and get notification when cache data is cleared completely use the clearCache(Callback) method.

void DotNetBrowser.CacheStorage.ClearCache ( Action  onCacheCleared)

Clears cache data in Browser's user data directory and notifies when cache is successfully cleared via passed onCacheCleared .

Parameters
onCacheClearedaction for notification when cache is cleared successfully. Can be null.