MCPcopy Create free account
hub / github.com/StarpTech/FastGraph / isResponseCachable

Function isResponseCachable

src/utils.ts:51–61  ·  view source on GitHub ↗
(res: Response)

Source from the content-addressed store, hash-verified

49}
50
51export function isResponseCachable(res: Response): boolean {
52 if (res.status === 206) return false
53
54 const vary = res.headers.get('vary') || ''
55 if (!!~vary.indexOf('*')) return false
56
57 const ccontrol = res.headers.get(Headers.cacheControl) || ''
58 if (/(private|no-cache|no-store)/i.test(ccontrol)) return false
59
60 return true
61}

Callers 1

graphqlFunction · 0.90

Calls 1

getMethod · 0.80

Tested by

no test coverage detected