MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getCacheControl

Function getCacheControl

source code/services/api/claude.ts:360–376  ·  view source on GitHub ↗
({
  scope,
  querySource,
}: {
  scope?: CacheScope
  querySource?: QuerySource
} = {})

Source from the content-addressed store, hash-verified

358}
359
360export function getCacheControl({
361 scope,
362 querySource,
363}: {
364 scope?: CacheScope
365 querySource?: QuerySource
366} = {}): {
367 type: 'ephemeral'
368 ttl?: '1h'
369 scope?: CacheScope
370} {
371 return {
372 type: 'ephemeral',
373 ...(should1hCacheTTL(querySource) && { ttl: '1h' }),
374 ...(scope === 'global' && { scope }),
375 }
376}
377
378/**
379 * Determines if 1h TTL should be used for prompt caching.

Callers 6

buildClaudeMdMessageFunction · 0.85
classifyYoloActionXmlFunction · 0.85
classifyYoloActionFunction · 0.85
buildSystemPromptBlocksFunction · 0.85

Calls 1

should1hCacheTTLFunction · 0.85

Tested by

no test coverage detected