The issue was related to Cloudflare caching, not the Flutter service worker itself. Here's what was happening and how to fix it:
Even though the service worker version was updating correctly in the flutter_bootstrap_js
, Cloudflare was serving cached versions of the assets, preventing the new version from being loaded immediately.
To resolve this issue, you need to:
Clear Cloudflare's cache:
(Optional) During development, you can:
Hope this helps others who might face similar issues with Flutter web deployments behind Cloudflare!
Tags: cloudflare
, flutter-web
, caching
, cdn