Class CacheKeyConfig
Internal configuration for the cache which will be relevant for generating the cache key.
[InternalApi_DoNotUse_MayChangeWithoutNotice]
public record CacheKeyConfig : ICanEstimateSize, IEquatable<CacheKeyConfig>
- Inheritance
-
objectCacheKeyConfig
- Implements
Remarks
This is used to determine which parameters will be used to pre-check the cache. Because of this, it must be a pure, simple record (to allow for easy comparison) and never contain any objects which are specific to the current request.
Constructors
CacheKeyConfig()
Internal configuration for the cache which will be relevant for generating the cache key.
public CacheKeyConfig()
Remarks
This is used to determine which parameters will be used to pre-check the cache. Because of this, it must be a pure, simple record (to allow for easy comparison) and never contain any objects which are specific to the current request.
CacheKeyConfig(NoParamOrder, int?, string?, string?, string?)
public CacheKeyConfig(NoParamOrder npo = default, int? seconds = null, string? varyBy = null, string? url = null, string? model = null)
Parameters
npoNoParamOrdersecondsint?varyBystringurlstringmodelstring
Fields
Disabled
public const int Disabled = -1
Field Value
EnabledWithoutTime
public const int EnabledWithoutTime = 0
Field Value
Properties
ByLanguage
public bool ByLanguage { get; init; }
Property Value
ByModel
public CacheKeyConfigNamed? ByModel { get; init; }
Property Value
- CacheKeyConfigNamed
ByModule
public bool ByModule { get; init; }
Property Value
ByPage
public bool ByPage { get; init; }
Property Value
ByPageParameters
this must be tracked in addition to the list page parameters, because even if the parameters are empty, it must still be activated on re-checking the cache.
public CacheKeyConfigNamed? ByPageParameters { get; init; }
Property Value
- CacheKeyConfigNamed
ByUser
public bool ByUser { get; init; }
Property Value
ForElevation
Rules per elevation; the value is the sliding expiration in seconds.
public Dictionary<UserElevation, int> ForElevation { get; init; }