Table of Contents

Interface IRazorConfiguration

Namespace
ToSic.Sxc.Code.Razor
Assembly
ToSic.Sxc.Code.dll

Configure Razor - for example output caching.

[WorkInProgressApi("not yet public or final, WIP v20.00.0x")]
public interface IRazorConfiguration

Methods

PartialCache(NoParamOrder, int?, string?, string?, string?, string?, Func<ICacheSpecs, ICacheSpecs>?)

Configure output of Razor partials caching.

string? PartialCache(NoParamOrder npo = default, int? seconds = null, string? watch = null, string? varyBy = null, string? url = null, string? model = null, Func<ICacheSpecs, ICacheSpecs>? tweak = null)

Parameters

npo NoParamOrder

see Convention: Named Parameters

seconds int?

sliding seconds to keep the cache, like 60, 300, 3600

watch string

what to watch for to flush the cache - recommended: data,folder

varyBy string

what to vary the cache by, like user,module,language, default is nothing. all cached output will be the same

url string

url parameters to vary by

model string

when caching by model properties, the model property names like id,key, default is nothing.

tweak Func<ICacheSpecs, ICacheSpecs>

extended / custom configuration of the cache - use for advanced config like elevation based variants

Returns

string

always returns null so it can be used inline in Razor.

Remarks

Will only have an effect if the feature LightSpeedOutputCachePartials is enabled.