# Apache Cache Control for Be Right Back
# Ensures HTML, PHP, Service Workers, and Manifests are always fetched fresh on reload

<IfModule mod_headers.c>
  # 1. HTML and PHP files: Never cache in browser memory/disk
  <FilesMatch "\.(html|htm|php)$">
    Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
    Header set Pragma "no-cache"
    Header set Expires "0"
  </FilesMatch>

  # 2. Service Worker & Manifest: Always check network
  <FilesMatch "(sw\.js|manifest\.webmanifest)$">
    Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
    Header set Pragma "no-cache"
    Header set Expires "0"
  </FilesMatch>
</IfModule>

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/html "access plus 0 seconds"
  ExpiresByType application/javascript "access plus 0 seconds"
</IfModule>
