invalidateCache static method

void invalidateCache(
  1. String path
)

Clear cache for a specific path and its parent.

Implementation

static void invalidateCache(String path) {
  _cache.remove(path);

  // Also invalidate parent directory.
  final parentPath = PodPath.getParentPath(path);
  if (parentPath != path) {
    _cache.remove(
      parentPath.endsWith('/')
          ? parentPath.substring(0, parentPath.length - 1)
          : parentPath,
    );
  }
  debugPrint('PodDirectoryService: Invalidated cache for: $path');
}