Interface IRequestCache

Signature for a component that implements support to cache values on current request (for a web application a Http request)

Namespace: EPiServer.Framework.Cache
Assembly: EPiServer.Framework.dll
Version: 12.0.3
Syntax
public interface IRequestCache

Properties

IsActive

Indicates if caching is active for current scope

Declaration
bool IsActive { get; }
Property Value
Type Description
System.Boolean
Remarks

For a http context based implementation the implementation returns true if a http context is present

Methods

Get<T>(String)

Gets a previously cached value (if exist)

Declaration
T Get<T>(string key)
Parameters
Type Name Description
System.String key

The unique key for the item

Returns
Type Description
T

The cached item or default(T) if not present.

Type Parameters
Name Description
T

The type of the cached item

Set<T>(String, T)

Inserts a value in the cache

Declaration
void Set<T>(string key, T value)
Parameters
Type Name Description
System.String key

The unique key for the item

T value

The item to cache

Type Parameters
Name Description
T

The type of the item to cache

Extension Methods