Edit

Share via


FileCache Class

Definition

Provides methods and tools to cache files in a folder

public class FileCache : Microsoft.Toolkit.Uwp.UI.CacheBase<Windows.Storage.StorageFile>
type FileCache = class
    inherit CacheBase<StorageFile>
Public Class FileCache
Inherits CacheBase(Of StorageFile)
Inheritance
CacheBase<Windows.Storage.StorageFile>
FileCache

Constructors

FileCache()

Properties

CacheDuration

Gets or sets the life duration of every cache entry.

(Inherited from CacheBase<T>)
HttpClient

Gets instance of HttpClient

(Inherited from CacheBase<T>)
Instance

Gets public singleton property.

MaxMemoryCacheCount

Gets or sets max in-memory item storage count

(Inherited from CacheBase<T>)
RetryCount

Gets or sets the number of retries trying to ensure the file is cached.

(Inherited from CacheBase<T>)

Methods

ClearAsync()

Clears all files in the cache

(Inherited from CacheBase<T>)
ClearAsync(TimeSpan)

Clears file if it has expired

(Inherited from CacheBase<T>)
GetFileFromCacheAsync(Uri)

Gets the StorageFile containing cached item for given Uri

(Inherited from CacheBase<T>)
GetFromCacheAsync(Uri, Boolean, CancellationToken, List<KeyValuePair<String,Object>>)

Retrieves item represented by Uri from the cache. If the item is not found in the cache, it will try to downloaded and saved before returning it to the caller.

(Inherited from CacheBase<T>)
GetFromMemoryCache(Uri)

Retrieves item represented by Uri from the in-memory cache if it exists and is not out of date. If item is not found or is out of date, default instance of the generic type is returned.

(Inherited from CacheBase<T>)
InitializeAsync(StorageFolder, String, HttpMessageHandler)

Initializes FileCache and provides root folder and cache folder name

(Inherited from CacheBase<T>)
InitializeTypeAsync(StorageFile, List<KeyValuePair<String,Object>>)

Cache specific hooks to process items from HTTP response

InitializeTypeAsync(Stream, List<KeyValuePair<String,Object>>)

Cache specific hooks to process items from HTTP response

IsFileOutOfDateAsync(StorageFile, TimeSpan, Boolean)

Override-able method that checks whether file is valid or not.

(Inherited from CacheBase<T>)
PreCacheAsync(Uri, Boolean, Boolean, CancellationToken)

Assures that item represented by Uri is cached.

(Inherited from CacheBase<T>)
RemoveAsync(IEnumerable<Uri>)

Removed items based on uri list passed

(Inherited from CacheBase<T>)
RemoveExpiredAsync(Nullable<TimeSpan>)

Removes cached files that have expired

(Inherited from CacheBase<T>)

Applies to