keys abstract method

Future<List<String>> keys()

Returns every stored key, expired or not, and removes nothing.

Reading must not delete. Both built-in backends used to purge expired entries while walking, which made a listing destructive in a way its name gave no hint of — and destructive of the wrong thing: an expired entry is exactly what networkFirst serves when the network is gone, and what cacheFirst serves while it revalidates. Calling getCacheKeys() to see what was cached therefore threw away the offline fallback, silently, leaving a cache miss where there had been data.

Use CacheInterceptor.evictExpired() when removing them is the intent.

Implementation

Future<List<String>> keys();