Options -Indexes

# Serve JSX as JavaScript (Babel compiles in-browser)
AddType application/javascript .jsx

# PWA — manifest must be served with correct MIME type
AddType application/manifest+json .json

# Service worker — must not be cached so browser always gets the latest version
<Files "sw.js">
  Header set Cache-Control "no-store, no-cache, must-revalidate"
  Header set Service-Worker-Allowed "/"
</Files>

# No caching for config (allows hot-swap without browser cache issues)
<Files "config.js">
  Header set Cache-Control "no-store, no-cache, must-revalidate"
</Files>

# No caching for manifest (install prompt picks up icon/name changes immediately)
<Files "manifest.json">
  Header set Cache-Control "no-store, no-cache, must-revalidate"
</Files>

# 1-hour cache for all static assets
<FilesMatch "\.(js|jsx|css|svg|woff2|png|jpg|ico)$">
  Header set Cache-Control "public, max-age=3600, must-revalidate"
</FilesMatch>

# SPA fallback — serve index.html for any missing path
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^ /index.html [L]
</IfModule>
