Grok WorldGrok Build CLI field station

回顧期號 / PERFORMANCE

替 prompt caching 設計 stable prefix

讓 durable instruction 與 reusable context 保持穩定,volatile user data 放在 request 後段。

01 / DECIDE

架構決策

適合重複大型 context,cache behavior 能降低 latency 與 usage 的情境。

讓 durable instruction 與 reusable context 保持穩定,volatile user data 放在 request 後段。 先把 input、output、state、tool 與 side effect 畫成一條可觀察路徑,再決定 替 prompt caching 設計 stable prefix 的 owner。

02 / OPERATE

三步野戰程序

  1. 01

    鎖定合約

    寫下 caller、資料分類、成功條件、timeout、取消與 ownership。適合重複大型 context,cache behavior 能降低 latency 與 usage 的情境。

  2. 02

    執行有界路徑

    只建立一條 end-to-end path,保留 correlation、typed state 與 reversible failure。讓 durable instruction 與 reusable context 保持穩定,volatile user data 放在 request 後段。

  3. 03

    驗證訊號

    把驗收變成可重跑的 fixture、contract test 或 browser test。Telemetry 比較 cached token、latency、cost 與 task quality,但不記錄 private content。

03 / BOUND

Operation 邊界

不可為提升 cache hit 而複製敏感內容;retention 與 authorization 優先。

04 / PROVE

驗收證據

Telemetry 比較 cached token、latency、cost 與 task quality,但不記錄 private content。

SOURCE / HTTP

可重現來源探針

curl -fsSI 'https://docs.x.ai/developers/advanced-api-usage/prompt-caching' | sed -n '1,5p'