Caching Stack Explained
The BlitzPress Caching Stack
BlitzPress uses a 4-layer caching architecture to deliver sub-second page loads.
Layer 1: OPcache (PHP Bytecode)
PHP files are compiled to bytecode and stored in shared memory. This eliminates filesystem reads on every request, giving a 10-30% PHP execution speed boost. OPcache is enabled server-wide and requires no per-site configuration.
Layer 2: Redis Object Cache
WordPress database queries are cached in Redis. Instead of hitting MariaDB on every page load, frequently used data (options, transients, user sessions) is served from memory.
- Per-site isolation: Each site gets its own Redis database (1-15)
- Key prefix:
bp_{domain}:prevents key collisions - Serialization: igbinary (faster + smaller than PHP serialize)
- Memory limit: 256MB with LRU eviction (least recently used data expires first)
Layer 3: LSCache (Full Page Cache)
OpenLiteSpeed’s built-in LiteSpeed Cache module caches entire HTML pages at the web server level — before PHP even runs. Cached pages are served directly from memory in under 1ms.
- TTL: 7 days for the front page, configurable per page type
- Smart invalidation: Cache automatically purges when content changes
- ESI support: Edge Side Includes allow caching pages while keeping dynamic fragments (cart, login status) fresh
- Browser caching: Static assets (images, CSS, JS) cached in the browser for 1 year
Layer 4: Cloudflare CDN (Optional)
With Cloudflare proxy enabled, your pages are cached at 300+ edge locations worldwide. Visitors are served from the nearest data center.
Cache Flow
Request → Cloudflare Edge Cache (if CF enabled)
↓ miss
→ OLS LSCache (full page, served in <1ms)
↓ miss
→ PHP + Redis Object Cache (database queries from memory)
↓ miss
→ MariaDB (actual database query, result cached in Redis)
mu-plugins for Performance
- evo-cache-boost.php — Prefetching, allOptions splitting, cache analytics, cache warming, conflict plugin blocking
- evo-esi-fragments.php — ESI fragment support for dynamic content in cached pages
- evo-frontend-optimize.php — CSS/JS minification, async loading, image lazy loading, DNS prefetch