pub enum CacheTtl {
FiveMinutes,
OneHour,
Off,
}Expand description
Cache-TTL knob exposed on AskConfig.
Anthropic’s ephemeral cache supports two TTLs:
- 5 minutes (default) — break-even at 2 calls per cached prefix; right for interactive REPL use where users ask a few questions in a session.
- 1 hour — costs 2× write premium instead of 1.25×; needs 3+ calls per prefix to break even. Worth it for long-running editor / desktop sessions where the same DB is queried sporadically over an hour.
Variants§
FiveMinutes
OneHour
Off
Disables caching — schema block is sent without a
cache_control marker. Useful when the schema is below the
model’s minimum cacheable prefix size (~2K tokens for Sonnet,
~4K for Haiku/Opus); marking it would be a no-op.
Trait Implementations§
impl Copy for CacheTtl
impl Eq for CacheTtl
impl StructuralPartialEq for CacheTtl
Auto Trait Implementations§
impl Freeze for CacheTtl
impl RefUnwindSafe for CacheTtl
impl Send for CacheTtl
impl Sync for CacheTtl
impl Unpin for CacheTtl
impl UnsafeUnpin for CacheTtl
impl UnwindSafe for CacheTtl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.