Last updated December 15, 2016
Fastly provides a Soft Purge feature that allows you to mark content as outdated (stale) instead of permanently purging and thereby deleting it from Fastly's caches. Objects invalidated with Soft Purge will be treated as outdated (stale) while Fastly fetches a new version from origin. You can purge by URL or by surrogate key using Soft Purge.
Before using Soft Purge, we recommend you implement one of the following revalidation methods:
stale_while_revalidateto serve stale content and fetch the newest version of the object from origin in the background. If you choose this revalidation method, consider also configuring
stale_if_errorat the same time.
- Set up
Last-Modifiedheaders for relevant content on your origin servers.
To implement Soft Purge, add a
Fastly-Soft-Purge request header (such as
Fastly-Soft-Purge: 1) to any single URL or key-based purge. For example, to purge the URL
www.example.com with Soft Purge, you would issue the following command:
curl -X PURGE -H "Fastly-Soft-Purge:1" http://www.example.com