RazorEngine


InvalidatingCachingProvider

Defined in RazorEngine.dll.

An memory leaking invalidating caching provider (See ICachingProvider). This implementation does a very simple in-memory caching and allows you to release templates by trading with memory. WARNING: Use this caching provider only on AppDomains you recycle regularly, or to improve the debugging experience. Never use this in production without any recycle strategy.

Constructors

ConstructorDescription
new()
Signature: unit -> unit

Initializes a new instance of the DefaultCachingProvider class.

new(registerForCleanup)
Signature: registerForCleanup:Action<string> -> unit

Initializes a new instance of the DefaultCachingProvider class.

Instance members

Instance memberDescription
CacheTemplate(template, templateKey)
Signature: (template:ICompiledTemplate * templateKey:ITemplateKey) -> unit
Modifiers: abstract

Caches a template. See ICachingProvider.CacheTemplate.

Dispose()
Signature: unit -> unit
Modifiers: abstract

Dispose the instance.

InvalidateAll()
Signature: unit -> unit

Invalidates all compilations. WARNING: leads to memory leaks

InvalidateCache(templateKey)
Signature: templateKey:ITemplateKey -> unit

Invalidates all compilations of the given template. WARNING: leads to memory leaks

InvalidateCacheOfType(...)
Signature: (templateKey:ITemplateKey * modelType:Type) -> unit

Invalidates the compilation of the given template with the given model-type. WARNING: leads to memory leaks

TryRetrieveTemplate(...)
Signature: (templateKey:ITemplateKey * modelType:Type * compiledTemplate:byref<ICompiledTemplate>) -> bool
Modifiers: abstract

Try to retrieve a template from the cache. See ICachingProvider.TryRetrieveTemplate.

Returns:

TypeLoader
Signature: TypeLoader
Modifiers: abstract

The manages InvalidatingCachingProvider.TypeLoader. See ICachingProvider.TypeLoader

Static members

Static memberDescription
GetModelTypeKey(modelType)
Signature: modelType:Type -> Type

Get the key used within a dictionary for a modelType.

Fork me on GitHub