# OPTIONAL: Apache 2.4.10+ example, not enabled automatically.
# Copy to .htaccess in the STATIC installation root only if your hosting
# permits these directives (AllowOverride FileInfo / Indexes as applicable).
# If enabling it causes HTTP 500, remove .htaccess and ask your host.
# No rewrite rules and no forced redirects are required.

<IfModule mod_dir.c>
  DirectoryIndex index.html
</IfModule>
<IfModule mod_mime.c>
  AddType text/javascript .js .mjs
  AddType text/css .css
  AddType application/json .json
  AddType image/svg+xml .svg
  AddType application/zip .zip
  AddCharset UTF-8 .html .css .js .mjs .json .txt .md
</IfModule>
<IfModule mod_headers.c>
  Header always set Access-Control-Allow-Origin "*"
  Header always set X-Content-Type-Options "nosniff"
  # Revalidate UI, manifests and unversioned files by default.
  Header set Cache-Control "no-cache"
  # Immutable caching ONLY for versioned distribution files and ZIPs.
  # REQUEST_URI matching also works under an installation subdirectory.
  Header set Cache-Control "public, max-age=31536000, immutable" "expr=%{REQUEST_URI} =~ m#/(libs|packages)/[a-z0-9-]+/[0-9]+\.[0-9]+\.[0-9]+/(dist/)?[^/]+\.(js|mjs|css|zip)$#"
</IfModule>
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css text/javascript application/json image/svg+xml
</IfModule>
