BackupCacheStore class

A store saving responses in a dedicated primary store and secondary store.

Cached responses are read from primary first, and then from secondary.

Mostly useful when you want MemCacheStore before another.

Inheritance

Constructors

BackupCacheStore({required CacheStore primary, required CacheStore secondary})

Properties

hashCode int
The hash code for this object.
no setterinherited
primary CacheStore
Primary cache store
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondary CacheStore
Secondary cache store
final

Methods

clean({CachePriority priorityOrBelow = CachePriority.high, bool staleOnly = false}) Future<void>
Removes all keys from store. priorityOrBelow flag will remove keys only for the priority or below. staleOnly flag will remove keys only if expired (from maxStale).
override
close() Future<void>
Releases underlying resources (if any)
override
delete(String key, {bool staleOnly = false}) Future<void>
Removes the given key from store. staleOnly flag will remove it only if the key is expired (from maxStale).
override
deleteFromPath(RegExp pathPattern, {Map<String, String?>? queryParams}) Future<void>
Removes keys from the given filters.
override
exists(String key) Future<bool>
Checks if key exists in store
override
get(String key) Future<CacheResponse?>
Retrieves cached response from the given key.
override
getFromPath(RegExp pathPattern, {Map<String, String?>? queryParams}) Future<List<CacheResponse>>
Retrieves cached responses from a path pattern.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pathExists(String url, RegExp pathPattern, {Map<String, String?>? queryParams}) bool
Checks if the given url matches with the given filters. url must conform to uri parsing.
inherited
set(CacheResponse response) Future<void>
Pushes response in store
override
toString() String
A string representation of this object.
inherited

Operators

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