MCPcopy Create free account
hub / github.com/Noumena-Network/code / getCacheControl

Function getCacheControl

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

Source from the content-addressed store, hash-verified

363}
364
365export function getCacheControl({
366 scope,
367 querySource,
368}: {
369 scope?: CacheScope
370 querySource?: QuerySource
371} = {}): {
372 type: 'ephemeral'
373 ttl?: '1h'
374 scope?: CacheScope
375} {
376 return {
377 type: 'ephemeral',
378 ...(should1hCacheTTL(querySource) && { ttl: '1h' }),
379 ...(scope === 'global' && { scope }),
380 }
381}
382
383/**
384 * 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