CacheManager class

A manager for multi-level caching

Constructors

CacheManager.new({int maxMemoryCacheSize = 50 * 1024 * 1024, int maxDiskCacheSize = 500 * 1024 * 1024, String? diskCacheDirectory, DataChunker? dataChunker, Logger? logger})
Creates a new CacheManager

Properties

diskCacheDirectory String?
The base directory for the disk cache
final
hashCode int
The hash code for this object.
no setterinherited
logger Logger?
Logger for logging operations
final
maxDiskCacheSize int
The maximum size of the disk cache in bytes
final
maxMemoryCacheSize int
The maximum size of the memory cache in bytes
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() Future<void>
Clears the cache
get<T>(String key, {List<CacheLevel>? levels}) Future<T?>
Gets a cache entry
getSize() Future<Map<CacheLevel, int>>
Gets the size of the cache
initialize() Future<void>
Initializes the cache manager
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put<T>(String key, T data, {CacheOptions options = const CacheOptions()}) Future<void>
Puts a cache entry
remove(String key) Future<void>
Removes a cache entry
toString() String
A string representation of this object.
inherited

Operators

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