# IRMSA Risk Intelligence Platform — Apache config for Axxess shared hosting (PLAN.md §11).
# Deployed to the edition root (e.g. public_html/stage/risk-report/2026/.htaccess).
# Fully static + self-contained: single-thread DuckDB-WASM needs NO COOP/COEP headers.

Options -Indexes
DirectoryIndex index.html

# Trailing-slash canonical is handled by mod_dir for real directories (each route is a folder).

<IfModule mod_headers.c>
  # Cache-busted, content-hashed assets — cache hard for a year.
  <FilesMatch "\.(?:js|css|woff2|woff|wasm)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
  </FilesMatch>
  # Images/data (art, report pages, parquet) — cache a week (immutable per edition).
  <FilesMatch "\.(?:jpg|jpeg|png|svg|parquet)$">
    Header set Cache-Control "public, max-age=604800"
  </FilesMatch>
  # Never cache build/manifest metadata or HTML, so new builds are picked up immediately.
  <FilesMatch "(?:build\.json|manifest\.json)$">
    Header set Cache-Control "no-cache, must-revalidate"
  </FilesMatch>
  <FilesMatch "\.html$">
    Header set Cache-Control "no-cache, must-revalidate"
  </FilesMatch>
</IfModule>

<IfModule mod_mime.c>
  AddType application/wasm .wasm
  AddType application/vnd.apache.parquet .parquet
  AddType font/woff2 .woff2
</IfModule>

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml
</IfModule>
