MemoryCacheStore class

Thread-safe in-memory cache store with tag-based indexing and metrics.

Implemented types

Constructors

MemoryCacheStore({int maxEntries = 1000})

Properties

count → int
Current number of stored cache entries.
no setter
evictions → int
Total capacity-triggered LRU evictions.
no setter
expiredCount → int
Total entries dropped due to expiration.
no setter
hashCode → int
The hash code for this object.
no setterinherited
hitRatio → double
Cache hit ratio (0.0 to 1.0).
no setter
hits → int
Total successful cache hits.
no setter
invalidations → int
Total entries purged via tag or key invalidation.
no setter
maxEntries → int
final
misses → int
Total cache misses.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → Future<void>
Clears the entire cache store.
override
delete(String key) → Future<void>
Deletes a cache entry by key.
override
deleteByTag(String tag) → Future<void>
Invalidates and removes all cache entries tagged with tag.
override
deleteByTags(List<String> tags) → Future<void>
Invalidates and removes all entries matching any of tags.
override
get(String key, {bool allowStale = false}) → Future<CacheEntry?>
Retrieves a cache entry by key. If allowStale is true, returns entries within the Stale-While-Revalidate or Stale-If-Error windows.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(String key, CacheEntry entry) → Future<void>
Stores or updates an entry by key.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited