IHttpCacheStore Interface
Provides persistent storage for HTTP cache entries.
public interface IHttpCacheStoreMethods
| Name | Description |
|---|---|
| GetEntriesAsync(string, CancellationToken) | Gets all entries associated with a primary cache key. |
| PruneObsoleteEntriesAsync(CancellationToken) | Removes obsolete entries that are expired and cannot be reused when stale. |
| RemoveEntriesAsync(string, CancellationToken) | Removes all entries associated with a primary cache key. |
| SetEntryAsync(string, HttpCachePersistenceEntry, CancellationToken) | Adds or replaces a cache entry for a primary key. |
GetEntriesAsync(string, CancellationToken)
Gets all entries associated with a primary cache key.
ValueTask<IReadOnlyCollection<HttpCachePersistenceEntry>> GetEntriesAsync(string primaryKey, CancellationToken cancellationToken)Parameters
primaryKeystring- The primary cache key.
cancellationTokenCancellationToken- The cancellation token.
Returns
PruneObsoleteEntriesAsync(CancellationToken)
IHttpCacheStore.csRemoves obsolete entries that are expired and cannot be reused when stale.
public ValueTask PruneObsoleteEntriesAsync(CancellationToken cancellationToken = default)RemoveEntriesAsync(string, CancellationToken)
Removes all entries associated with a primary cache key.
ValueTask RemoveEntriesAsync(string primaryKey, CancellationToken cancellationToken)Parameters
primaryKeystring- The primary cache key.
cancellationTokenCancellationToken- The cancellation token.
Returns
SetEntryAsync(string, HttpCachePersistenceEntry, CancellationToken)
Adds or replaces a cache entry for a primary key.
ValueTask SetEntryAsync(string primaryKey, HttpCachePersistenceEntry entry, CancellationToken cancellationToken)Parameters
primaryKeystring- The primary cache key.
entryHttpCachePersistenceEntry- The entry to store.
cancellationTokenCancellationToken- The cancellation token.