purgeSurrogateKey

Functionin compute@fastly/js-compute 4.0.0since 3.22.0View source
purgeSurrogateKey(surrogateKey: string, soft?: boolean): void

Purge the given surrogate key from Fastly's HTTP and Core caches.

There are two purge modes: hard purge (the default) clears all matching items from the cache immediately, while soft purge retains stale entries in the cache, reducing origin load while enabling stale revalidations.

See the Fastly Purge documentation for more information on caching and purge operations.

Parameters

surrogateKey: string

The surrogate key string to purge.

soft: booleanoptional

Enable to perform a soft purge, retaining stale cache entries to reduce load on the origin server. Defaults to a hard purge.

Returns

void