CacheConfig.staleWhileRevalidate constructor

const CacheConfig.staleWhileRevalidate({
  1. required IwsCache cache,
  2. Duration? ttl,
  3. bool forceRefresh = false,
})

Creates a cache config with stale-while-revalidate enabled

Implementation

const CacheConfig.staleWhileRevalidate({
  required this.cache,
  this.ttl,
  this.forceRefresh = false,
}) : staleWhileRevalidate = true;