newCacheInterceptor function

Interceptor newCacheInterceptor(
  1. String pattern,
  2. Cache cache
)

Creates a new Interceptor backed by the provided Cache

  • pattern: All the calls with a url matching this pattern will be cached

Returns a Interceptor

Implementation

Interceptor newCacheInterceptor(String pattern, Cache cache) {
  return (CacheInterceptorBuilder()..cache(pattern, cache)).build();
}