You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DO NOT WORK ON OR MERGE THIS DOC ISSUE YET.
This issue tracks documentation updates for the experimental --web-content-hash feature in Flutter Web (Umbrella Issue: flutter/flutter#149031).
Implementation is currently in Phase 1 (executable entrypoints only). Do not draft or merge documentation updates on docs.flutter.dev until the upcoming Q4 stable release is finalized and the feature has matured.
With the introduction of content-hashed web entrypoints in the Flutter build system (flutter build web --web-content-hash, flutter/flutter#149031), the Flutter Web deployment guide will need guidance on configuring web server and CDN Cache-Control response headers.
Without explicit server header configuration:
Serving index.html or flutter_bootstrap.js with long-term cache headers causes browsers to retain stale application manifests across deployments.
Serving hashed executable assets without Cache-Control: immutable forces redundant network revalidations on every user visit.
Rationale: In Phase 1 of web content hashing, asset bundles and Wasm source maps (which embed unhashed custom section pointers) retain fixed filenames across builds and require regular revalidation.
Example Hosting Configurations:
Include sample configuration snippets for common hosting providers (Firebase Hosting firebase.json headers block, Netlify _headers, and Nginx server blocks).
Warning
DO NOT WORK ON OR MERGE THIS DOC ISSUE YET.
This issue tracks documentation updates for the experimental
--web-content-hashfeature in Flutter Web (Umbrella Issue: flutter/flutter#149031).Implementation is currently in Phase 1 (executable entrypoints only). Do not draft or merge documentation updates on
docs.flutter.devuntil the upcoming Q4 stable release is finalized and the feature has matured.Page URL
https://docs.flutter.dev/deployment/web
Problem
With the introduction of content-hashed web entrypoints in the Flutter build system (
flutter build web --web-content-hash, flutter/flutter#149031), the Flutter Web deployment guide will need guidance on configuring web server and CDNCache-Controlresponse headers.Without explicit server header configuration:
index.htmlorflutter_bootstrap.jswith long-term cache headers causes browsers to retain stale application manifests across deployments.Cache-Control: immutableforces redundant network revalidations on every user visit.Proposed Content
Add a dedicated "Web server and CDN caching configuration" section to https://docs.flutter.dev/deployment/web covering:
Bootstrap & Manifest Files (Revalidate):
index.html,flutter_bootstrap.js,manifest.json,version.jsonCache-Control: no-cache, must-revalidate(ormax-age=0, must-revalidate)Hashed Executable Binaries (Immutable):
main.dart.<hash>.js,main.dart.<hash>.wasm,main.dart.<hash>.mjs,main.dart.<hash>.js.map,main.dart.<hash>.mjs.mapCache-Control: public, max-age=31536000, immutableUnhashed Static Assets & Wasm Source Maps (Moderate TTL):
assets/*,canvaskit/*,flutter.js, andmain.dart.wasm.mapCache-Control: public, max-age=3600, must-revalidate(or appropriate CDN cache profile)Example Hosting Configurations:
firebase.jsonheaders block, Netlify_headers, and Nginx server blocks).