Skip to content

Swr.Net assembly

public typedescription
interface ISwrProvides stale-while-revalidate caching with user-supplied fetchers. Register via AddSwrForBlazor or AddSwrForAspNetCore.
record SwrOptionsConfiguration options for SWR caching behavior. Can be set globally via DI or overridden per request.
class SwrResult<T>Represents the result of an SWR cache lookup. Properties update asynchronously as data flows through cache hit, network fetch, and background revalidation.
public typedescription
static class SwrServiceCollectionExtensionsExtension methods for registering Swr.Net services with the DI container.
public typedescription
static class SwrCacheKeyUtilities for normalizing and constructing SWR cache keys.
public typedescription
record CacheEntryRepresents a cached data entry with its storage timestamp. Used by ISwrStore implementations to track cache age.
interface ISwrStoreAbstraction for the SWR cache storage backend. Implement this to use a custom store (e.g., Redis via IDistributedCache). The default implementation is an in-memory ConcurrentDictionary-based store.