# Hot reload development
flutter run -d chrome --web-experimental-hot-reload
# Development build (preserves placeholders)
./scripts/dev-build.sh# Build with cache busting (recommended for production)
./scripts/build-with-cache-busting.sh
# Build specific targets
./scripts/build-with-cache-busting.sh main # Main app only
./scripts/build-with-cache-busting.sh styleguide # Styleguide onlyThis repository now includes a comprehensive cache busting solution that resolves Safari's aggressive caching problems:
- Service Workers with intelligent cache management
- Automatic versioning based on timestamp + git hash
- Build scripts for seamless production deployment
- Cache control headers for proper browser behavior
- Progressive Web App compatibility maintained
- ✅ Changes appear immediately after deployment
- ✅ Works in both Safari incognito and regular modes
- ✅ No manual cache clearing required
- ✅ Preserves development workflow
- ✅ Automatic fallback strategies for network issues
scripts/
├── update-cache-version.sh # Updates version placeholders
├── build-with-cache-busting.sh # Production build with cache busting
└── dev-build.sh # Development build (no cache busting)
web/
├── sw.js # Service worker for main app
├── index.html # Updated with service worker registration
└── manifest.json # Updated with version field
flutter_styleguide/web/
├── sw.js # Service worker for styleguide
├── index.html # Updated with service worker registration
└── manifest.json # Updated with version field
docs/
└── cache-busting-deployment.md # Detailed documentation
- Build Time:
__BUILD_VERSION__placeholders get replaced withYYYYMMDDHHMMSS-{git-hash} - Service Worker: Manages cache strategies per resource type
- Browser: Automatically downloads updates when versions change
- Fallback: Network-first strategy ensures latest content
- ✅ Run production build:
./scripts/build-with-cache-busting.sh - ✅ Deploy built files to hosting service
- ✅ Configure server headers (see
docs/cache-busting-deployment.md) - ✅ Test in both incognito and regular browser modes
- ✅ Verify service worker registration in DevTools
- Changes not appearing? Check DevTools > Application > Service Workers
- Cache issues persist? Hard refresh: Cmd+Shift+R (Mac) or Ctrl+Shift+R (Windows)
- Service worker errors? Check browser console and
docs/cache-busting-deployment.md
For detailed documentation, see docs/cache-busting-deployment.md.