MCPcopy Create free account
hub / github.com/axe-api/axe-api / defaultCacheKeyFunction

Function defaultCacheKeyFunction

packages/axe-api/src/Handlers/Helpers.ts:508–523  ·  view source on GitHub ↗
(req: AxeRequest)

Source from the content-addressed store, hash-verified

506};
507
508export const defaultCacheKeyFunction = (req: AxeRequest) => {
509 return JSON.stringify({
510 url: req.url,
511 method: req.method,
512 headers: {
513 Accept: req.header("Accept"),
514 "Accept-Encoding": req.header("Accept-Encoding"),
515 "Accept-Language": req.header("Accept-Language"),
516 Authorization: req.header("Authorization"),
517 Host: req.header("Host"),
518 Origin: req.header("Origin"),
519 Referer: req.header("Referer"),
520 "User-Agent": req.header("User-Agent"),
521 },
522 });
523};
524
525export const toCacheTagKey = (
526 model: IModelService,

Callers 1

toCacheKeyFunction · 0.85

Calls 1

headerMethod · 0.45

Tested by

no test coverage detected