Commit 69ae986
committed
fix: 撤回省 CPU hack,恢复 best practice(dashboard 数据修订诊断)
用户 review 后指出"丢西瓜捡芝麻"风险,复盘 Vercel 30 天 dashboard 后修订:
## 真实根因(不是 /_not-found)
dashboard 30 天曲线显示 5/11 CPU 峰值 80-90min(基线 5-15min/day),完美
对应 SEO PR 落地时间:
- 5/11 15:01-15:39 UTC: PR #341 (253 MDX descriptions + 32 新 EN 翻译)
- 5/11 16:02-18:41 UTC: PR #342 (remark heading shift + leetcode dedup)
- 5/11 19:01-19:27 UTC: PR #343 + #340,4 小时 4 次 deploy 清空 ISR
加上 deploy.yml 里 IndexNow 主动告诉 Bing 重抓 → 5/10-5/12 crawler 风暴。
**这是 SEO 工作 successful 的代价,不是 bug。** 真实流量。
/_not-found 静态化 + bot blocklist 是真实 waste 清理(保留),但不能独立
解释 4× 激增。
## 撤回的两条 hack
1. Sentry tracesSampleRate 0.1 → 0.02:撤回,保持 10%
observability 不能为这点 CPU 让步,10% 是行业标准,client/server/edge
三处必须一致才能跨 runtime 串联 trace。
2. fetchEvents 失败一律返空:改成只在 NEXT_PHASE === phase-production-build
时返空,运行时仍 throw 让 Sentry 抓真故障。否则 prod backend 挂了会被
误显示成"暂无活动",掩盖故障。
## 保留的修复(best practice,不是 hack)
- /_not-found ƒ → ○:根 404 本就不需要 i18n
- proxy.ts bot blocklist:扫描器不该烧 Fluid
- /[locale]/docs /events /login 缺 setRequestLocale → 补:SSG/ISR 本就该工作
- /editor /share cascade ●:纯 client component,安全
## Build 验证
pnpm build 重跑:
- /[locale]/events 仍是 ● ISR 5m 1y
- [events] fetch failed at build, rendering empty shell(NEXT_PHASE guard 工作)1 parent 7828000 commit 69ae986
4 files changed
Lines changed: 85 additions & 31 deletions
File tree
- app/[locale]/events
- dev_docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
33 | 41 | | |
34 | 42 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 43 | | |
40 | | - | |
41 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
| |||
49 | 58 | | |
50 | 59 | | |
51 | 60 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
59 | 71 | | |
60 | | - | |
61 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
62 | 81 | | |
63 | 82 | | |
64 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
13 | 31 | | |
14 | 32 | | |
15 | 33 | | |
| |||
152 | 170 | | |
153 | 171 | | |
154 | 172 | | |
155 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
156 | 184 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
161 | 192 | | |
162 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
163 | 196 | | |
164 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
165 | 200 | | |
166 | 201 | | |
167 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments