Skip to content

Runbook: Cache Purge

When to Purge

  • After deploying CSS/JS changes
  • When published content is not appearing on the live site
  • After changing site-wide settings (menus, widgets, ACF options)
  • After bulk content updates

Purge Order

Always purge from innermost to outermost layer:

1. WordPress (WP Rocket) → 2. Varnish → 3. Cloudflare

Step 1: Purge WP Rocket

Via Admin

  1. WordPress Admin → WP Rocket → Dashboard
  2. Click "Clear Cache"

Via WP-CLI (if available)

bash
wp rocket clean --confirm

Step 2: Purge Varnish

Purge Specific URL

bash
# SSH into Varnish server
varnishadm -T localhost:6082 -S /etc/varnish/secret "ban req.url ~ ^/the-specific-path"

Purge Everything

bash
varnishadm -T localhost:6082 -S /etc/varnish/secret "ban req.url ~ ."

Verify Varnish Status

bash
# Check backend health
varnishadm -T localhost:6082 -S /etc/varnish/secret "backend.list"

# Monitor cache hits in real-time
varnishlog -g raw -i Backend_health

Step 3: Purge Cloudflare

Via Plugin (Preferred)

The dezeen-cloudflare-purge-manager plugin automatically purges on post publish. Check the plugin's log page for status.

Via Cloudflare Dashboard

  1. Log into Cloudflare Dashboard
  2. Select dezeen.com zone
  3. Caching → Configuration → Purge Everything
  4. Or: Custom Purge → Enter specific URLs

Via Cloudflare API

bash
curl -X POST "https://api.cloudflare.com/client/v4/zones/{ZONE_ID}/purge_cache" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -H "Content-Type: application/json" \
  --data '{"purge_everything": true}'

Step 4: Verify

bash
# Check Cloudflare cache status
curl -I https://www.dezeen.com/ | grep -i cf-cache-status
# Should show MISS on first request, then HIT

# Check Varnish
curl -I https://www.dezeen.com/ | grep -i x-varnish

# Check page content is fresh
curl -s https://www.dezeen.com/ | head -50

Purging Static Assets Only

If only CSS/JS changed:

  1. Cloudflare → Custom Purge → Enter asset URLs:
    • https://static.dezeen.com/d/assets/css/style-min.css
    • https://static.dezeen.com/d/assets/js/min/scripts-min.js
  2. Or purge by prefix: https://static.dezeen.com/d/assets/

Gotchas

  • Browser cache: Users may have old assets cached locally. The DZN_TEMPLATE_VERSION constant provides cache-busting. Update it after asset changes.
  • Cloudflare edge cache: Even after purging, some edge nodes may take 30–60 seconds to clear.
  • Varnish probe delay: After maintenance mode, nodes take 5–15 seconds to come back online (probe interval × window).
  • WP Rocket and Varnish overlap: Both cache full pages. Purge both to ensure consistency.