Table of Contents

Class AppsCacheBase

Namespace
ToSic.Eav.Caching
Assembly
ToSic.Eav.Core.dll

The Apps Cache is the main cache for App States.
This is just the abstract base implementation. The real cache must implement this and also provide platform specific adjustments so that the caching is in sync with the Environment.

[InternalApi_DoNotUse_MayChangeWithoutNotice("this is just fyi")]
public abstract class AppsCacheBase : IAppsCache, IHasIdentityNameId
Inheritance
AppsCacheBase
Implements

Properties

NameId

Primary identifier of an object which has this property. It will be unique and used as an ID where needed.

public virtual string NameId { get; }

Property Value

string

Priority

public virtual int Priority { get; }

Property Value

int

Methods

Get(IAppIdentity, IAppLoaderTools)

Retrieve an app from the cache or build it if not yet available.

public IAppStateCache Get(IAppIdentity app, IAppLoaderTools tools)

Parameters

app IAppIdentity

App identifier.

tools IAppLoaderTools

Current service provider, in case the app must be retrieved / generated

Returns

IAppStateCache

The IAppStateCache of the app.

Has(IAppIdentity)

Check if something is already in the cache

public bool Has(IAppIdentity app)

Parameters

app IAppIdentity

App identifier.

Returns

bool

IsViable()

public virtual bool IsViable()

Returns

bool

Load(IAppIdentity, string, IAppLoaderTools)

Load an app into cache, specifying the primary language. This is used in scenarios, where the primary language cannot be auto-detected, so it's set explicitly.

public void Load(IAppIdentity app, string primaryLanguage, IAppLoaderTools tools)

Parameters

app IAppIdentity

App identifier.

primaryLanguage string

Primary language, lower case.

tools IAppLoaderTools

Purge(IAppIdentity)

Clean cache for specific Zone and App

public void Purge(IAppIdentity app)

Parameters

app IAppIdentity

PurgeZones()

Clean entire global cache, which includes the List of Zones and Apps as well as all the apps.

public abstract void PurgeZones()

Update(IAppIdentity, IEnumerable<int>, ILog, IAppLoaderTools)

Tell the cache that an app has done a partial update. Only relevant for farm scenarios, where other nodes must be informed.

public virtual IAppStateCache Update(IAppIdentity appIdentity, IEnumerable<int> entities, ILog log, IAppLoaderTools tools)

Parameters

appIdentity IAppIdentity
entities IEnumerable<int>

List of entities which need to be updates.

log ILog

Log object to log what's happening.

tools IAppLoaderTools

Returns

IAppStateCache

The updated IAppStateCache or null, if it wasn't in the cache so didn't need updating.

Zones(IAppLoaderTools)

public abstract IReadOnlyDictionary<int, Zone> Zones(IAppLoaderTools tools)

Parameters

tools IAppLoaderTools

Returns

IReadOnlyDictionary<int, Zone>