Class GlobalListCache

Assembly: redb.Core.dll

Domain-isolated cache for lists and their items.
Hybrid model: TTL for eventual consistency + local invalidation on changes.
Instance is bound to specific domain, static data is shared.

public sealed class GlobalListCache

Inheritance

ObjectGlobalListCache

Properties

Domain

Domain identifier for this cache instance.

public string Domain { get; }

IsEnabled

Check if cache is enabled.

public bool IsEnabled { get; }

Methods

CacheList(RedbList)

Cache list.

public void CacheList(RedbList list)

CacheListItems(long, List<RedbListItem>)

Cache list items.

public void CacheListItems(long listId, List<RedbListItem> items)

Clear()

Clear cache for this domain.

public void Clear()

GetCacheSize()

Get cache size statistics.

public (int Lists, int Items) GetCacheSize()

GetList(long)

Get list by ID.

public RedbList? GetList(long id)

GetListByName(string)

Get list by name.

public RedbList? GetListByName(string name)

GetListItem(long)

Get list item by ID.

public RedbListItem? GetListItem(long itemId)

GetListItems(long)

Get list items by list ID.

public List<RedbListItem>? GetListItems(long listId)

InvalidateList(long)

Invalidate list and its items.

public void InvalidateList(long listId)

InvalidateListItem(long)

Invalidate single list item.

public void InvalidateListItem(long itemId)

InvalidateListItems(long)

Invalidate list items.

public void InvalidateListItems(long listId)

SetEnabled(bool)

Enable or disable cache for this domain.

public void SetEnabled(bool enabled)

SetTtl(TimeSpan)

Set TTL for the cache.

public void SetTtl(TimeSpan ttl)

Constructors

GlobalListCache(string?, bool?)

Create cache instance for specific domain.