Skip to content

Caching & Performance

Cache Layer Overview

Cache Layers

LayerTechnologyTTLScopePurge Method
BrowserCache-Control headersShort (set by dezeen-cache-control plugin)Per-userHeaders
CDNCloudflareVaries by resource typeGlobal edgeCloudflare API / dashboard
Page cacheVarnish~1 dayPer-URLAutomatic on publish; manual via varnishadm
Application cacheWP RocketUntil purgePer-URLWP Rocket admin; automatic on publish
Object cacheRedis (planned) / TransientsVariesPer-keywp cache flush; Redis FLUSHDB
ACF cacheACF internalSessionPer-requestACF 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.sh

Purge

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

SettingValue
Plugin version3.20.3
Page cachingEnabled (WP_CACHE = true)
Debug modeControlled by WP_ROCKET_DEBUG constant
Cache bustingFix 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

ToolPurpose
WP Smush Pro (3.16.4)Image compression, lazy loading, WebP conversion
smush-archive-guard.phpPrevents re-processing images uploaded before 2026-01-15
Theme lazy loadingCustom lazysize.js implementation
CDNImages served via static.dezeen.com

Performance Optimisations in Theme

The theme's functions/performance.php implements:

FeatureHookPriority
CLS optimisation styleswp_head5
Preload critical resourceswp_head1
Font display swapwp_head2
Ad container optimisationwp_footer5
CLS monitoring scriptwp_footer10
Conditional YouTube lite embedwp_enqueue_scripts15

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

IssueImpactMitigation
Heavy ACF usageSlow cold-start queriesACF_CACHE=true, database indexing
Many active pluginsHigh hook count, increased memoryWP_MEMORY_LIMIT=256M, memory_limit=1024M
Missing DB indexesSlow meta queriesSee setup/optimisations/db-indexes.txt
Large media librarySmush processing timeArchive guard prevents re-processing old images
Multiple Algolia pluginsPotential conflictsConsolidation planned

Redis Object Cache

SettingValue
PluginRedis Object Cache 2.7.0
Host127.0.0.1
Port6379
Database0
Prefixdezeen_acf_
StatusUncertain — 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 cacheable

Check 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 MISS

Check WP Rocket

  1. View page source — look for <!-- This website is like a Rocket --> comment at bottom
  2. Check _project/_web/wp-content/cache/wp-rocket/ for cached files
  3. Enable WP_ROCKET_DEBUG in 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