Provider-native context cache marker transforms.
Provider-native context cache marker transforms.
(apply-marker-to-message message ttl-marker layout)Place a cache_control marker on a provider-native message.
Place a cache_control marker on a provider-native message.
(apply-system-and-3 messages)(apply-system-and-3 messages
{:keys [ttl layout breakpoints]
:or {ttl "5m" layout :native breakpoints 4}})Apply system_and_3 caching to a vector of provider-native messages.
Apply system_and_3 caching to a vector of provider-native messages.
(apply-system-blocks-cache system-blocks {:keys [ttl] :or {ttl "5m"}})Place cache_control on the last Anthropic system content block.
Place cache_control on the last Anthropic system content block.
(apply-tools-cache tools {:keys [ttl] :or {ttl "5m"}})Mark the last Anthropic tools[] item as cacheable.
Mark the last Anthropic tools[] item as cacheable.
(marker)(marker ttl)Build a cache_control marker for the given TTL ('5m' or '1h').
The ttl is emitted explicitly for both known durations. We used to omit it for '5m' and lean on the provider's implicit ephemeral default — but Anthropic silently changed that default from 1h to 5m on 2026-03-06, which silently shortened the cache lifetime of every consumer that relied on it. Pinning the ttl in cache_control makes the requested duration explicit and immune to future default shifts. An unrecognized ttl falls back to a bare marker (the provider default) rather than sending an invalid value.
Build a cache_control marker for the given TTL ('5m' or '1h').
The ttl is emitted *explicitly* for both known durations. We used to omit it
for '5m' and lean on the provider's implicit ephemeral default — but Anthropic
silently changed that default from 1h to 5m on 2026-03-06, which silently
shortened the cache lifetime of every consumer that relied on it. Pinning the
ttl in cache_control makes the requested duration explicit and immune to future
default shifts. An unrecognized ttl falls back to a bare marker (the provider
default) rather than sending an invalid value.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |