# Cloudflare Pages HTTP headers
# Format: pattern \n  Header-Name: value
# Docs: https://developers.cloudflare.com/pages/configuration/headers/

# --- Security headers for all pages ---
/*
  X-Frame-Options: DENY
  X-Content-Type-Options: nosniff
  Referrer-Policy: strict-origin-when-cross-origin
  Permissions-Policy: geolocation=(), microphone=(), camera=()
  Strict-Transport-Security: max-age=31536000; includeSubDomains
  Content-Security-Policy: default-src 'self'; img-src 'self' data: https://raw.githubusercontent.com https://tally.so https://www.google-analytics.com https://*.googletagmanager.com https://*.g.doubleclick.net; style-src 'self' 'unsafe-inline' https://tally.so; script-src 'self' 'unsafe-inline' https://tally.so https://www.googletagmanager.com https://static.cloudflareinsights.com; font-src 'self' https://tally.so; connect-src 'self' https://tally.so https://api.tally.so https://www.google-analytics.com https://*.analytics.google.com https://*.g.doubleclick.net https://stats.g.doubleclick.net https://static.cloudflareinsights.com https://cloudflareinsights.com; frame-src 'self' https://tally.so; media-src 'self'

# --- i18n / styling: short cache so a forgotten ?v= bump self-heals ---
# Listed BEFORE the wildcard rules below so they win on path match.
# These three files are the ones the HP keeps revising — locking them
# at 1 year immutable cost us several rounds of "I shipped the fix but
# nobody sees it" with returning visitors. 10 minutes matches the HTML
# revalidation interval below, so HTML + i18n + style stay in sync.
/i18n.js
  Cache-Control: public, max-age=600, must-revalidate

/consent.js
  Cache-Control: public, max-age=600, must-revalidate

/styles.css
  Cache-Control: public, max-age=600, must-revalidate

# --- Aggressive caching for static assets (1 year, immutable) ---
/*.svg
  Cache-Control: public, max-age=31536000, immutable
  Access-Control-Allow-Origin: *

/*.css
  Cache-Control: public, max-age=31536000, immutable

/*.js
  Cache-Control: public, max-age=31536000, immutable

/*.woff2
  Cache-Control: public, max-age=31536000, immutable

# --- HTML pages: short cache + revalidate ---
/*.html
  Cache-Control: public, max-age=600, must-revalidate

/
  Cache-Control: public, max-age=600, must-revalidate
