swadhinbiswas feat: new feacture added · 8/31/2026
6500ca6
54 lines · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# 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