cached method

ProxyResolution? cached(
  1. Uri uri, {
  2. bool allowStale = false,
})

The cached resolution for uri's origin, or null. Expired entries are returned only when allowStale is true.

Implementation

ProxyResolution? cached(Uri uri, {bool allowStale = false}) {
  if (uri.host.isEmpty) return null;
  final key = cacheKey(uri);
  return allowStale ? _cache[key]?.resolution : _fresh(key);
}