Commit f417863
* docs(examples): showcase 的 cacheTtl 注释写成 private —— 运行时发的就是它,且它是安全规则 (#5244)
`examples/app-showcase/src/system/apis/index.ts` 里 `TaskFeedEndpoint.cacheTtl`
上方的注释把响应头写成 `Cache-Control: public, max-age=30`,运行时发的是
`private, max-age=30`(`packages/runtime/src/endpoint-policy.ts` 的
`computeCacheControl`;PR #5230 的真实 boot 探针 P1 也打印了实测值)。
`private` 在这条链上不是调优选择而是安全规则:任何一条响应都可能按调用者被 RLS
裁剪,共享缓存绝不能存下来再发给别人。而这份文件是声明式端点唯一的一手示例,是 AI
作者最可能整段抄走的那份 —— 抄走 `public` 正好得出该规则要挡住的推断。
因此除了把 `public` 改成 `private`,注释还点明它不是本示例的调优选择(在
`authRequired: false` 上同样成立),并**引用** `computeCacheControl` 的文档块而不是
复述第二套规则;顺带把 `cacheTtl: 0` 的语义(`no-store`,不是「不发头」)一并指过去。
注释的后半句(只随成功答案上线、不随 401/429/5xx、GET-only)本来就是对的,保留。
零行为变更:不动运行时,不动声明本身(`cacheTtl: 30` 是对的)。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VkPSGsX9o17MsGv3Lbxu2w
* docs(examples): 把「every ttl」收紧成「every positive ttl」(#5244)
自查时发现上一版注释里「the runtime emits it for every ttl」本身就不准:`private`
只出现在正 ttl 上,`cacheTtl: 0` 走的是 `no-store`,并不带 `private`。这正是本 PR 要
消灭的那一类失真,故就地收紧为「every positive ttl」,与紧随其后的 `cacheTtl: 0`
说明自洽。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VkPSGsX9o17MsGv3Lbxu2w
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5897552 commit f417863
1 file changed
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
85 | 92 | | |
86 | 93 | | |
87 | 94 | | |
| |||
0 commit comments