MCPcopy Create free account
hub / github.com/github/docs / purgeFastlyBySurrogateKey

Function purgeFastlyBySurrogateKey

script/deployment/purge-edge-cache.js:18–28  ·  view source on GitHub ↗
({ apiToken, serviceId, surrogateKey })

Source from the content-addressed store, hash-verified

16const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
17
18async function purgeFastlyBySurrogateKey({ apiToken, serviceId, surrogateKey }) {
19 const safeServiceId = encodeURIComponent(serviceId)
20
21 const headers = {
22 'fastly-key': apiToken,
23 accept: 'application/json',
24 'fastly-soft-purge': '1',
25 }
26 const requestPath = `https://api.fastly.com/service/${safeServiceId}/purge/${surrogateKey}`
27 return got.post(requestPath, { headers, json: true })
28}
29
30export default async function purgeEdgeCache(
31 surrogateKey,

Callers 1

purgeEdgeCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected