-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_headers
More file actions
30 lines (27 loc) · 873 Bytes
/
Copy path_headers
File metadata and controls
30 lines (27 loc) · 873 Bytes
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
# Cache headers for GitHub Pages + Cloudflare
# Static assets: 1 year + immutable (cache-bust via ?v= when updating)
*.css
Cache-Control: public, max-age=31536000, immutable
*.js
Cache-Control: public, max-age=31536000, immutable
*.webp
Cache-Control: public, max-age=31536000, immutable
*.svg
Cache-Control: public, max-age=31536000, immutable
*.png
Cache-Control: public, max-age=31536000, immutable
*.ico
Cache-Control: public, max-age=31536000, immutable
*.webmanifest
Cache-Control: public, max-age=31536000, immutable
# HTML: no browser cache, but allow CDN (Cloudflare) to cache 10 min
*.html
Cache-Control: public, max-age=0, s-maxage=600, must-revalidate
# Root page
/
Cache-Control: public, max-age=0, s-maxage=600, must-revalidate
# Text & XML: 1 day
*.txt
Cache-Control: public, max-age=86400
*.xml
Cache-Control: public, max-age=86400