SaaS CMS has officially launched! Learn more now.

Class ReadStrategy

Used to specify how cache reads should be handled

Inheritance
System.Object
ReadStrategy
Namespace: EPiServer.Framework.Cache
Assembly: EPiServer.Framework.dll
Version: 12.0.3
Syntax
public sealed class ReadStrategy : Enum

Fields

Immediate

Will not wait for other pending updates

Declaration
public const ReadStrategy Immediate
Field Value
Type Description
ReadStrategy

value__

Declaration
public int value__
Field Value
Type Description
System.Int32

Wait

Will wait for pending updates to finish

Declaration
public const ReadStrategy Wait
Field Value
Type Description
ReadStrategy
Remarks

Typically used for scenarios where there is likely that several calls are done concurrently for an item that is costly to load. In that case only one will perform the actual load while others will wait. When the loading is done the waiting threads will be signalled.

This option adds a marker object to the cache to signal that data is being loaded. Do not use the same cache key with other API's that do not take ReadStrategy since they will return the marker object if called, for example during a costly database operation.

Extension Methods