# MeinWeimar TOURGUIDE – Flutter Web cache policy
# v0.14.7: During active development/launch, EVERY refresh must revalidate
# the complete Flutter application. This avoids mixed releases on Chrome/iOS
# (new HTML with old main.dart.js / MaterialIcons / manifests / assets).
<IfModule mod_headers.c>
# Never cache the application shell, compiled Dart/JS, Flutter manifests,
# fonts/icons, WASM or JSON. Browser refresh therefore asks the server again.
<FilesMatch "\.(html|js|mjs|json|wasm|woff|woff2|ttf|otf|map)$">
Header always set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
Header always set Pragma "no-cache"
Header always set Expires "0"
</FilesMatch>
# Flutter assets can keep stable URLs across releases, so image changes must
# also not be allowed to survive a deployment on a user's device.
<FilesMatch "\.(png|jpg|jpeg|webp|svg|ico)$">
Header always set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
Header always set Pragma "no-cache"
Header always set Expires "0"
</FilesMatch>
# Explicitly cover extensionless/known Flutter files too.
<FilesMatch "^(index\.html|flutter_bootstrap\.js|flutter\.js|main\.dart\.js|version\.json|manifest\.json|AssetManifest.*|FontManifest\.json|update\.html)$">
Header always set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
Header always set Pragma "no-cache"
Header always set Expires "0"
</FilesMatch>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
# Flutter SPA fallback, but never swallow real files/directories.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>

