Fastly - how to Purge by Surrogate Key
The Fastly CDN allows for fast, sub-second purging of content.
The regular purge command is by URL, for example like this:
curl -X PURGE http://url-of-asset-to-purge
To have better context sensitive control over the purging process, you can associate a surrogate key to every piece of content, and then purge by key.
To associate a surrogate key with content, add a header on your origin that specifies at least one surrogate key. Related content can share the same key.
HTTP/1.1 200 OK Surrogate-Key: key1 key2 key3 Content-Type: text/html
To purge a specific surrogate key, POST a request like this:
Replace <service-id> and <surrogate-key> with your values
Fastly - Adding authorization to PURGE (Views: 1456)
Fastly - how to temporarily disable the cache (Views: 1362)
EdgeCast - Adding a new user for Purge Only (Views: 1073)
Fastly - how to change origin timeouts? (Views: 1246)
Adding Cache-control to a website (Apache) (Views: 1270)