Repository navigation
Expand file tree
/
Copy path_headers
More file actions
42 lines (39 loc) · 1.79 KB
/
Copy path_headers
File metadata and controls
42 lines (39 loc) · 1.79 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
# 全站安全响应头(Cloudflare Pages)
/*
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=(), payment=(), usb=(), bluetooth=(), interest-cohort=()
Cross-Origin-Opener-Policy: same-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
# HTML 永不进边缘缓存:国内外分流中间件(_middleware.js)必须对每个请求生效,
# 否则边缘缓存会把某一国家版的页面发给另一国家用户(串国),也会让中间件改动不生效。
/*.html
Cache-Control: no-store
/
Cache-Control: no-store
# CSS/JS:Pages 默认 max-age=0 must-revalidate(每次访问都 304 协商)。
# 给 10 分钟强缓存 + 后台重验证:重复访问零请求,部署后最多 10 分钟全量生效。
/index.css
Cache-Control: public, max-age=600, stale-while-revalidate=300
/app.js
Cache-Control: public, max-age=600, stale-while-revalidate=300
/go.js
Cache-Control: public, max-age=600, stale-while-revalidate=300
/sponsor.js
Cache-Control: public, max-age=600, stale-while-revalidate=300
/mox-session.js
Cache-Control: public, max-age=600, stale-while-revalidate=300
/me-assets.js
Cache-Control: public, max-age=600, stale-while-revalidate=300
/sub-page.js
Cache-Control: public, max-age=600, stale-while-revalidate=300
/status.js
Cache-Control: public, max-age=600, stale-while-revalidate=300
/fan-assets/*
Cache-Control: public, max-age=600, stale-while-revalidate=300
# WebGPU SDK 资源:允许任意前端跨域引用(<script src> 或 ES module import),
# 支撑「任何有自己官网/前端的项目都能直接调 GPU」的设想
/webgpu/*
Access-Control-Allow-Origin: *
Cross-Origin-Resource-Policy: cross-origin