defaultRevalidatedFiles top-level constant

Set<String> const defaultRevalidatedFiles

Files a build regenerates without putting a content hash in their name.

A cache that keeps one of these keeps the whole application: the browser holds a stale document, that document asks for the entry script it remembers, and the new build is never fetched. It shows up a day after a deploy as "users are on the old version and a hard refresh fixes it".

These names cover what the common toolchains emit. Bundlers that hash every asset — Vite, Rollup, esbuild — need only the document and the service worker; Flutter also ships unhashed entry files. Pass revalidate: to replace the set when a toolchain uses other names.

Implementation

const defaultRevalidatedFiles = <String>{
  'index.html',
  'manifest.json',
  'version.json',
  'service-worker.js',
  'sw.js',
  'flutter.js',
  'flutter_bootstrap.js',
  'flutter_service_worker.js',
  'main.dart.js',
  'main.dart.mjs',
  'main.dart.wasm',
};