# Cloudflare Pages headers configuration
# https://developers.cloudflare.com/pages/configuration/headers/
# Security headers for all pages
/*
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()
# Cache static assets aggressively
/_astro/*
Cache-Control: public, max-age=31536000, immutable
/assets/*
Cache-Control: public, max-age=31536000, immutable
/*.js
Cache-Control: public, max-age=31536000, immutable
/*.css
Cache-Control: public, max-age=31536000, immutable
# Cache images
/*.png
Cache-Control: public, max-age=604800
/*.jpg
Cache-Control: public, max-age=604800
/*.svg
Cache-Control: public, max-age=604800
/*.ico
Cache-Control: public, max-age=604800
# Service worker must never be cached by the CDN (immutable .js rule above would apply)
/sw.js
Cache-Control: public, max-age=0, must-revalidate
Service-Worker-Allowed: /
# Don't cache HTML (for fresh content)
/*.html
Cache-Control: public, max-age=0, must-revalidate
# JSON files (search index, leetcode data)
/*.json
Cache-Control: public, max-age=3600
# Sitemap
/sitemap*.xml
Cache-Control: public, max-age=86400