# ===================================================================
# Save Pet — Apache configuration for shared hosting
# Safe to delete if your host doesn't support .htaccess (mod_rewrite
# isn't even required here — this file only sets MIME types, cache
# headers and compression, all optional niceties).
# ===================================================================

<IfModule mod_mime.c>
  AddType application/manifest+json .json
  AddType application/manifest+json .webmanifest
  AddType audio/mpeg .mp3
  AddType audio/ogg .ogg
  AddType audio/wav .wav
  AddType image/svg+xml .svg
</IfModule>

<IfModule mod_headers.c>
  # CRITICAL: never let browsers/proxies cache the service worker
  # file itself, or players will get stuck on an old version.
  <FilesMatch "sw\.js$">
    Header set Cache-Control "no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires 0
  </FilesMatch>

  <FilesMatch "\.html$">
    Header set Cache-Control "no-cache, must-revalidate"
  </FilesMatch>

  <FilesMatch "\.(png|jpg|jpeg|gif|svg|ico|wav|mp3|ogg)$">
    Header set Cache-Control "public, max-age=2592000, immutable"
  </FilesMatch>

  <FilesMatch "\.(css|js)$">
    Header set Cache-Control "public, max-age=86400"
  </FilesMatch>

  Header set X-Content-Type-Options "nosniff"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

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

DirectoryIndex index.html
Options -Indexes
