clearCaches static method

Future<void> clearCaches()

Deletes every CacheStorage bucket, including the ones the Flutter service worker fills.

Implementation

static Future<void> clearCaches() async {
  try {
    final List<JSString> keys = (await web.window.caches.keys().toDart).toDart;
    for (final JSString key in keys) {
      try {
        await web.window.caches.delete(key.toDart).toDart;
      } catch (_) {}
    }
  } catch (_) {}
}