Skip to main content
Version: 3.23.0

purgeSurrogateKey

The purgeSurrogateKey() function is used to purge the given surrogate key string from Fastly's cache.

There are two purge modes: soft purge and hard purge, with hard purge as the default which clears all items from the cache immediately. When using a soft purge, stale entries are maintained in the cache, reducing orgin load, while also enabling stale revalidations.

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

Syntax

purgeSurrogateKey(surrogateKey, soft?)

Parameters

  • surrogateKey : string
    • The surrogate key string
  • soft? : boolean
    • Enables a soft purge, retaining stale entries in the cache. Default is a hard purge.

Return value

undefined.