warmup method

Future<void> warmup()

Eagerly populates the cache from the backing store.

Call this once during app startup so the first read on the request hot path doesn't pay for backing-store I/O. Subsequent calls are no-ops unless the cache has been invalidated.

Implementation

Future<void> warmup() async {
  if (_loaded) return;
  _cache = await _backing.read();
  _loaded = true;
}