revalidate static method

Future<void> revalidate(
  1. List<String> urls
)

Re-downloads urls and overwrites their HTTP cache entries, so the next navigation reads the server copy even for Cache-Control: immutable assets.

Implementation

static Future<void> revalidate(List<String> urls) async {
  await Future.wait(
    urls.map((String url) async {
      try {
        await web.window.fetch(url.toJS, web.RequestInit(cache: "reload")).toDart;
      } catch (_) {}
    }),
  );
}