anchor.diff:      return _internalHosts.every((p) => p.allMatches(uri.host).isEmpty);
     }
   
  +  /// Check the status of the URL, using validity checks, cache and
  +  /// safe URL checks with limited number of redirects.
     Future<UrlStatus> checkStatus(String url,
         {bool isInternalPackage = false}) async {
       if (url == null) {
  
positive.code:   exists,
  }
  
  class UrlChecker {
    final _internalHosts = <Pattern>{};
  
    UrlChecker() {
      addInternalHosts([
        'dart.dev',
        RegExp(r'.*\.dart\.dev'),
  
negative.code:     if (!isExternal && !isInternalPackage) {
        return UrlStatus.internal;
      }
  
      // check in cache
      if (await existsInCache(uri)) {
        return UrlStatus.exists;
      }
  
      final exists = await safeUrlCheck(uri);
      if (exists) {
        await markExistsInCache(uri);
        return UrlStatus.exists;
      } else {
        return UrlStatus.missing;
      }
    }
  
    /// Checks if the [uri] exists in cache. The cache contains only
    /// the valid URLs, failures (which may be short-lived, transient)
    /// are not stored, rather retried.
    ///
    /// Returns true if [uri] has been valid in the cache, false otherwise.
    Future<bool> existsInCache(Uri uri) async {
      return _validUrlCache.contains(uri.toString());
    }
  
    /// Marks the [uri] as valid in the cache.
    Future<void> markExistsInCache(Uri uri) async {
      while (_validUrlCache.length > _maxCacheSize) {
        _validUrlCache.remove(_validUrlCache.first);
      }
      _validUrlCache.add(uri.toString());
    }
  }
  
  