Repository navigation
Commit 76a0de9
feat(everything): add a per-registration cacheHint to the static doc resources
The 2026-07-28 cache fields resolve most-specific-author-first: fields the
handler returns, then a per-registration `cacheHint`, then the server-level
`ServerOptions.cacheHints`, then the conservative default (`ttlMs: 0`,
`cacheScope: "private"`).
Only the server level was in use, so reads of the static `docs/` resources fell
through to that default and were never cacheable. They are the one genuinely
static surface here - the files ship inside the package and change only when it
is rebuilt - so they now carry `{ ttlMs: 3_600_000, cacheScope: "public" }`.
`public` is correct because the content is identical for every caller. The
dynamic and session-scoped resources deliberately keep no hint and continue to
fall through to the conservative default.
Verified on the wire: a modern client reading a static document now sees
ttlMs=3600000 / cacheScope=public (vs the server-level 60s on tools/list), and
a legacy client still sees no cache fields at all.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 85bd7b9 commit 76a0de9
2 files changed
Lines changed: 37 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
42 | 58 | | |
43 | 59 | | |
44 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
46 | 61 | | |
47 | 62 | | |
48 | 63 | | |
49 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
50 | 69 | | |
51 | 70 | | |
52 | 71 | | |
| |||
0 commit comments