Interface IRazorConfiguration
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
npoNoParamOrdersecondsint?sliding seconds to keep the cache, like
60,300,3600watchstringwhat to watch for to flush the cache - recommended:
data,foldervaryBystringwhat to vary the cache by, like
user,module,language, default is nothing. all cached output will be the sameurlstringurl parameters to vary by
modelstringwhen caching by model properties, the model property names like
id,key, default is nothing.tweakFunc<ICacheSpecs, ICacheSpecs>extended / custom configuration of the cache - use for advanced config like elevation based variants
Returns
- string
always returns
nullso it can be used inline in Razor.
Remarks
Will only have an effect if the feature LightSpeedOutputCachePartials is enabled.