CacheLink constructor

CacheLink({
  1. CacheStore? store,
  2. CachePolicy defaultPolicy = CachePolicy.cacheFirst,
  3. Duration? defaultTtl,
})

Creates a cache link.

store is the cache storage backend. Defaults to InMemoryCacheStore. defaultPolicy is the caching strategy to use when not specified per-request. defaultTtl is the default time-to-live for cached entries.

Implementation

CacheLink({
  CacheStore? store,
  this.defaultPolicy = CachePolicy.cacheFirst,
  this.defaultTtl,
}) : store = store ?? InMemoryCacheStore();