clearCache method

Future<void> clearCache()

Clear browser cache for models

Deletes all cached model data from browser Cache API. This is separate from deleteModel() which only removes installation records.

Implementation

Future<void> clearCache() async {
  await _ensureInitialized();

  try {
    final registry = ServiceRegistry.instance;
    final downloadService = registry.downloadService as WebDownloadService;
    await downloadService.cacheService.clearCache();
    debugPrint('WebModelManager: Browser cache cleared');
  } catch (e) {
    debugPrint('WebModelManager: clearCache failed: $e');
    rethrow;
  }
}