getCustomCache method
IwsCache
getCustomCache({
- required String name,
- required bool persistent,
- int? maxSize,
- EvictionPolicy evictionPolicy = EvictionPolicy.lru,
- Duration cleanupInterval = const Duration(minutes: 30),
Get a custom cache instance with specific configuration
Implementation
IwsCache getCustomCache({
required String name,
required bool persistent,
int? maxSize,
EvictionPolicy evictionPolicy = EvictionPolicy.lru,
Duration cleanupInterval = const Duration(minutes: 30),
}) {
// You could store custom caches in a Map<String, IwsCache> if needed
if (persistent) {
return IwsPersistentCache(
maxSize: maxSize,
evictionPolicy: evictionPolicy,
cleanupInterval: cleanupInterval,
);
} else {
return IwsMemoryCache(
maxSize: maxSize,
evictionPolicy: evictionPolicy,
cleanupInterval: cleanupInterval,
);
}
}