MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getCacheControl

Function getCacheControl

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

Source from the content-addressed store, hash-verified

356}
357
358export function getCacheControl({
359 scope,
360 querySource,
361}: {
362 scope?: CacheScope
363 querySource?: QuerySource
364} = {}): {
365 type: 'ephemeral'
366 ttl?: '1h'
367 scope?: CacheScope
368} {
369 return {
370 type: 'ephemeral',
371 ...(should1hCacheTTL(querySource) && { ttl: '1h' }),
372 ...(scope === 'global' && { scope }),
373 }
374}
375
376/**
377 * 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