Fastly Purge Not Working (Old Content Still Served)
Quick answer
Old content after a Fastly purge is usually a shield and edge race: the edge re-caches stale content from the shield. Purge twice, a few seconds apart.
Most likely fix: Purge twice
How to fix it
Try these in order — the most common fix is first.
1. Purge twice
- Run the purge
- Run it again: about 2 seconds later for URL or surrogate key purges, about 30 seconds later for purge all
Did this fix it?2. Stop stale content being re-cached at the shield
- In VCL, on shield POPs (fastly.ff.visits_this_service > 0) set req.max_stale_while_revalidate = 0s
- Also set req.max_stale_if_error to 0s if you do not want stale content when the origin is down
Did this fix it?3. Use the right purge type
- URL purges invalidate all variants of an object
- Surrogate key purges only invalidate objects tagged with that key
- Purge all removes everything in the service, including versioned assets
Did this fix it?4. Authenticate API purges
- Send your API token in the Fastly-Key header over HTTPS
- A successful purge returns status ok and an id
- If authentication is required on the service, create a request header Fastly-Purge-Requires-Auth set to 1
Did this fix it?5. Avoid purging assets
- Publish scripts, styles and images at new versioned URLs
- Serve them with Cache-Control: max-age=31556952, immutable
Did this fix it?
Symptoms
You purged a URL or all content but visitors still see the old version.
Why it happens
- With shielding, the edge cache is purged first and then refetches unpurged content from the shield
- Soft purge with serve-stale lets a shield pass stale content that the edge caches as fresh
- Purge by URL does not match a variant tagged by surrogate key (and the reverse)
- URL purge authentication is enabled and the API token header is missing
- Browser or other caches hold the old file
This guide also covers
- fastly purge not working
- fastly cache not purging
- fastly purge not clearing cache
- fastly soft purge
Still not working?
If Fastly keeps failing, you're not alone. See every Fastly problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usOther Fastly errors
- Fastly Error: Unknown Domain
- Fastly 503 Backend Read Error / Connection Timeout
- Fastly TLS Certificate Stuck Pending or Not Provisioning
- Fastly Origin TLS Errors: Hostname Mismatch, Unable to Verify Certificate
- Fastly Not Caching: Always X-Cache MISS
- Fastly Serves Wrong Content or Denies Requests From Origin (Override Host)
- How to Cancel Fastly Account