1
0
mirror of synced 2026-01-03 06:04:16 -05:00
Files
docs/.github/actions-scripts/purge-fastly-edge-cache.js
2022-12-06 20:26:06 +00:00

21 lines
685 B
JavaScript
Executable File

#!/usr/bin/env node
import { SURROGATE_ENUMS } from '../../middleware/set-fastly-surrogate-key.js'
import purgeEdgeCache from '../../script/deployment/purge-edge-cache.js'
// This will purge every response that *contains* `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(SURROGATE_ENUMS.DEFAULT)