Caching & Performance
Cache Layer Overview
Cache Layers
| Layer | Technology | TTL | Scope | Purge Method |
|---|---|---|---|---|
| Browser | Cache-Control headers | Short (set by dezeen-cache-control plugin) | Per-user | Headers |
| CDN | Cloudflare | Varies by resource type | Global edge | Cloudflare API / dashboard |
| Page cache | Varnish | ~1 day | Per-URL | Automatic on publish; manual via varnishadm |
| Application cache | WP Rocket | Until purge | Per-URL | WP Rocket admin; automatic on publish |
| Object cache | Redis (planned) / Transients | Varies | Per-key | wp cache flush; Redis FLUSHDB |
| ACF cache | ACF internal | Session | Per-request | ACF handles automatically |
Cloudflare
Configuration
- Mode: Full CDN with WAF and DDoS protection
- DNS: Managed by Cloudflare
- Static assets: Cached at Cloudflare edge (CSS, JS, images, fonts)
- HTML: Passed through to Varnish (unless Cloudflare page rules cache it)
Purge
The dezeen-cloudflare-purge-manager plugin handles automatic cache purging:
- Purges homepage on post publish/update
- Fixes domain mapping issues (admin vs production URL)
- Logs purge operations for debugging
- Admin page: Settings → Cloudflare Purge Manager
Manual purge: Log into the Cloudflare dashboard → Caching → Purge Everything (or specific URLs).
Varnish
Configuration
- 2 Varnish servers in front of 4 Apache web nodes
- VCL files in
setup/production/varnish/(varnish-1-v8.vlc,varnish-2-v8.vlc) - Health probes:
/maintenance/endpoint every 5 seconds
Monitoring
bash
# Check backend health
varnishadm -T localhost:6082 -S /etc/varnish/secret "backend.list"
# Watch cache hits/misses
varnishlog -g raw -i Backend_health
# Validate VCL
setup/production/varnish/validate-vcl.shPurge
bash
# Purge specific URL
varnishadm -T localhost:6082 -S /etc/varnish/secret "ban req.url ~ ^/some-path"
# Purge everything
varnishadm -T localhost:6082 -S /etc/varnish/secret "ban req.url ~ ."WP Rocket
| Setting | Value |
|---|---|
| Plugin version | 3.20.3 |
| Page caching | Enabled (WP_CACHE = true) |
| Debug mode | Controlled by WP_ROCKET_DEBUG constant |
| Cache busting | Fix applied via wp-rocket-cache-busting-fix.php mu-plugin |
Known Issue
WP Rocket's cache-busting feature can throw E_WARNING errors when the cache/busting directory doesn't exist. The mu-plugin wp-rocket-cache-busting-fix.php suppresses these warnings.
dezeen-cache-control Plugin
Sets short browser TTL for HTML while keeping long shared-cache TTL for Varnish/Cloudflare:
Cache-Control: max-age=<short>, s-maxage=<long>This ensures:
- Browsers get fresh content quickly
- Varnish/Cloudflare can serve stale content while revalidating
Hook: send_headers at priority 999 (runs last).
Image Optimisation
| Tool | Purpose |
|---|---|
| WP Smush Pro (3.16.4) | Image compression, lazy loading, WebP conversion |
smush-archive-guard.php | Prevents re-processing images uploaded before 2026-01-15 |
| Theme lazy loading | Custom lazysize.js implementation |
| CDN | Images served via static.dezeen.com |
Performance Optimisations in Theme
The theme's functions/performance.php implements:
| Feature | Hook | Priority |
|---|---|---|
| CLS optimisation styles | wp_head | 5 |
| Preload critical resources | wp_head | 1 |
| Font display swap | wp_head | 2 |
| Ad container optimisation | wp_footer | 5 |
| CLS monitoring script | wp_footer | 10 |
| Conditional YouTube lite embed | wp_enqueue_scripts | 15 |
dezeen-performance-optimiser Plugin
Optimises WordPress autoload settings:
- Prevents large options from being autoloaded
- Cache optimisation for frequently-accessed options
- Update check throttling to reduce external HTTP requests
- Admin page: Settings → Performance Optimiser
Known Performance Constraints
| Issue | Impact | Mitigation |
|---|---|---|
| Heavy ACF usage | Slow cold-start queries | ACF_CACHE=true, database indexing |
| Many active plugins | High hook count, increased memory | WP_MEMORY_LIMIT=256M, memory_limit=1024M |
| Missing DB indexes | Slow meta queries | See setup/optimisations/db-indexes.txt |
| Large media library | Smush processing time | Archive guard prevents re-processing old images |
| Multiple Algolia plugins | Potential conflicts | Consolidation planned |
Redis Object Cache
| Setting | Value |
|---|---|
| Plugin | Redis Object Cache 2.7.0 |
| Host | 127.0.0.1 |
| Port | 6379 |
| Database | 0 |
| Prefix | dezeen_acf_ |
| Status | Uncertain — configured in wp-config but docs say "planned" |
Debugging Cache Issues
Check Cloudflare Cache Status
bash
curl -I https://www.dezeen.com/some-page/ | grep -i cf-cache-status
# HIT = served from Cloudflare edge
# MISS = fetched from origin
# DYNAMIC = not cacheableCheck Varnish Cache Status
bash
curl -I https://www.dezeen.com/some-page/ | grep -i x-varnish
# Two numbers = cache HIT (first is current, second is original request)
# One number = cache MISSCheck WP Rocket
- View page source — look for
<!-- This website is like a Rocket -->comment at bottom - Check
_project/_web/wp-content/cache/wp-rocket/for cached files - Enable
WP_ROCKET_DEBUGin wp-config for additional headers
Flush All Caches
bash
# WP Rocket (if WP-CLI available)
wp rocket clean --confirm
# Redis
wp cache flush
# Varnish (from Varnish server)
varnishadm "ban req.url ~ ."
# Cloudflare (via dashboard or API)See also: runbooks/cache-purge.md