isLongLivedStaticFileCached method

bool isLongLivedStaticFileCached(
  1. String filePath
)

Returns true if filePath matches any pattern in longLivedStaticFilesCached.

Implementation

bool isLongLivedStaticFileCached(String filePath) {
  if (!filePath.startsWith('/')) {
    filePath = '/$filePath';
  }

  return longLivedStaticFilesCached.any((p) {
    if (p is RegExp) {
      return p.hasMatch(filePath);
    } else {
      return filePath == p.toString();
    }
  });
}