Table of Contents

Class CacheKeyConfig

Namespace
ToSic.Sxc.Services.Cache.Sys.CacheKey
Assembly
ToSic.Sxc.Services.dll

Internal configuration for the cache which will be relevant for generating the cache key.

[InternalApi_DoNotUse_MayChangeWithoutNotice]
public record CacheKeyConfig : ICanEstimateSize, IEquatable<CacheKeyConfig>
Inheritance
object
CacheKeyConfig
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

npo NoParamOrder
seconds int?
varyBy string
url string
model string

Fields

Disabled

public const int Disabled = -1

Field Value

int

EnabledWithoutTime

public const int EnabledWithoutTime = 0

Field Value

int

Properties

ByLanguage

public bool ByLanguage { get; init; }

Property Value

bool

ByModel

public CacheKeyConfigNamed? ByModel { get; init; }

Property Value

CacheKeyConfigNamed

ByModule

public bool ByModule { get; init; }

Property Value

bool

ByPage

public bool ByPage { get; init; }

Property Value

bool

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

bool

ForElevation

Rules per elevation; the value is the sliding expiration in seconds.

public Dictionary<UserElevation, int> ForElevation { get; init; }

Property Value

Dictionary<UserElevation, int>