github-docs-arabic-enhanced / src /workflows /purge-fastly-edge-cache.ts
AbdulElahGwaith's picture
Upload folder using huggingface_hub
88df9e4 verified
import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key'
import purgeEdgeCache from './purge-edge-cache'
// This will purge every response that *contains*
// `process.env.FASTLY_SURROGATE_KEY || SURROGATE_ENUMS.DEFAULT`.
// We normally send Surrogate-Key values like:
//
// every-deployment language:en
// every-deployment language:fr
// every-deployment language:ja
// or
// every-deployment no-language
//
// But if you send a purge request for just:
//
// every-deployment
//
// It will cover all surrogate keys that contain that.
// So this the nuclear option for all keys with this prefix.
await purgeEdgeCache(process.env.FASTLY_SURROGATE_KEY || SURROGATE_ENUMS.DEFAULT)