cdn-cache-purge-testslisted
Install: claude install-skill testland/qa
# cdn-cache-purge-tests
## Overview
CDN cache-purge tests verify that the
write-origin-then-invalidate-edge sequence works end-to-end -
the most-likely-broken cache integration in real deployments.
Per
[developers.cloudflare.com/cache/how-to/purge-cache/](https://developers.cloudflare.com/cache/how-to/purge-cache/),
Cloudflare offers five purge methods (Single-file, Everything,
Cache-tags, Hostname, Prefix). Fastly's surrogate-key pattern
and CloudFront's invalidation API offer similar shapes.
## When to use
- Verifying a new purge integration works end-to-end.
- Regression-testing the write-origin-then-purge sequence.
- Auditing existing purge logic before a deploy.
- Investigating "users see stale content after a write."
## Authoring
### Cloudflare - purge by URL
```bash
curl -X POST \
"https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/purge_cache" \
-H "Authorization: Bearer ${CF_API_TOKEN}" \
-H "Content-Type: application/json" \
--data '{"files":["https://example.com/api/users/1"]}'
```
Response:
```json
{ "success": true, "result": { "id": "...." } }
```
### Cloudflare - purge by cache-tag (Enterprise)
```bash
curl -X POST "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/purge_cache" \
-H "Authorization: Bearer ${CF_API_TOKEN}" \
--data '{"tags":["user-1","posts-feed"]}'
```
The response headers from the origin must have included
`Cache-Tag: user-1, posts-feed` for this to work.
### Fastly - purge by surrogate-key
```bash
curl -X PO