---
title: Soft purges
summary: null
url: >-
  https://www.fastly.com/documentation/guides/full-site-delivery/purging/soft-purges
---


Fastly provides a Soft Purge feature that allows you to mark content as outdated (*stale*). Stale objects remain available to use in some circumstances while Fastly fetches a new version from origin, unlike objects invalidated by a *hard* purge which are made immediately unusable. You can [purge by URL](/guides/full-site-delivery/purging/purging-a-url) or by [surrogate key](/guides/full-site-delivery/purging/purging-with-surrogate-keys) using Soft Purge.

Before using Soft Purge, we recommend you implement one of the following methods to verify a stale object should temporarily remain in cache during revalidation:

- Set up `ETag` or `Last-Modified` headers for relevant content on your origin servers.
- Configure `stale_while_revalidate` to [serve stale content](/guides/full-site-delivery/performance/serving-stale-content) and fetch the newest version of the object from origin in the background. If you choose this revalidation method, you must also configure `stale_if_error` at the same time.

To enable Soft Purge, add a `Fastly-Soft-Purge` request header (such as `Fastly-Soft-Purge: 1`) to any single URL or key-based purge.

To purge the URL `www.example.com` with Soft Purge, you would issue the following command:

```term copy
$ curl -X PURGE -H "Fastly-Soft-Purge:1" http://www.example.com
```

To purge a surrogate key with Soft Purge, you would issue the following command:

```term copy
$ curl -X POST -H 'Fastly-Soft-Purge:1' -H 'Fastly-Key: YOUR_FASTLY_TOKEN' -H 'Accept: application/json' https://api.fastly.com/service/<SID>/purge/<S-Key>
```

> **IMPORTANT:** Purge all requests cannot be done as a soft purge and will always immediately invalidate all cached content associated with the service. To do a soft purge all, consider applying a constant [surrogate key](/guides/full-site-delivery/purging/working-with-surrogate-keys) tag (e.g., `all`) to all objects.