evictExpired method
Removes all expired entries from the cache.
This is useful for periodic cleanup in long-running applications. Some implementations may call this automatically during get/set operations.
Implementation
@override
void evictExpired() {
final expiredKeys = <String>[];
for (final entry in _cache.entries) {
if (entry.value.isExpired) {
expiredKeys.add(entry.key);
}
}
expiredKeys.forEach(delete);
}