Request 2 caches its request content (not the response) changedbuild-with-claude/prompt-caching
Recorded here
Lines+5added
Lines−5removed
From line
479
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits26to this page, all time
The whole hunk
from line 479, old and new numbered
/
from line 479
479479
480480With automatic caching, the cache point moves forward automatically as conversations grow. Each new request caches everything up to the last cacheable block, and previous content is read from cache.
481481
482| Request | Content | Cache behavior |
483| --------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
484| Request 1 | System + User(1) + Asst(1) + **User(2)** ◀ cache | Everything written to cache |
485| Request 2 | System + User(1) + Asst(1) + User(2) + Asst(2) + **User(3)** ◀ cache | System through User(2) read from cache; Asst(2) + User(3) written to cache |
486| Request 3 | System + User(1) + Asst(1) + User(2) + Asst(2) + User(3) + Asst(3) + **User(4)** ◀ cache | System through User(3) read from cache; Asst(3) + User(4) written to cache |
482| Request | Content | Cache behavior |
483| --------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
484| Request 1 | System<br />+ User(1) + Asst(1)<br />+ **User(2)** ◀ cache | Everything written to cache |
485| Request 2 | System<br />+ User(1) + Asst(1)<br />+ User(2) + Asst(2)<br />+ **User(3)** ◀ cache | System through User(2) read from cache;<br />Asst(2) + User(3) written to cache |
486| Request 3 | System<br />+ User(1) + Asst(1)<br />+ User(2) + Asst(2)<br />+ User(3) + Asst(3)<br />+ **User(4)** ◀ cache | System through User(3) read from cache;<br />Asst(3) + User(4) written to cache |
487487
488488The cache breakpoint automatically moves to the last cacheable block in each request, so you don't need to update any `cache_control` markers as the conversation grows.
489489
No line in this hunk matches that.