# Apache / cPanel hosting: correct file types and browser caching.
# Ignored by hosts that are not Apache (Netlify, Nginx, etc.).
DirectoryIndex index.html

<IfModule mod_mime.c>
  AddType image/webp .webp
  AddType font/woff2 .woff2
  AddType audio/mpeg .mp3
  AddType application/javascript .js
  AddType text/css .css
</IfModule>

<IfModule mod_headers.c>
  # Hashed build files never change: cache for a year
  <If "%{REQUEST_URI} =~ m#^/_next/static/#">
    Header set Cache-Control "public, max-age=31536000, immutable"
  </If>
  <FilesMatch "\.(webp|png|ico|mp3)$">
    Header set Cache-Control "public, max-age=604800"
  </FilesMatch>
  <FilesMatch "\.html$">
    Header set Cache-Control "no-cache"
  </FilesMatch>
</IfModule>
