The page cache stores a complete rendered response as a static file and serves it through the owned advanced-cache.php drop-in before WordPress boots. A full cache hit can avoid PHP, plugin hooks, and most database work for that request.
How a hit is created
- The request passes the cache safety gates.
- WordPress renders the page through the output buffer.
- Asset, image, CSS, and CDN policies finish their work.
- The final HTML is written atomically under
wp-content/cache/wppo/, with compression variants when the server supports them.
The drop-in serves the best stored variant, emits content validators, and can answer a matching conditional request with 304 Not Modified. A cache miss returns to the normal WordPress path.
Who is eligible
Anonymous requests are eligible when the URL and response are safe. Logged-in variants are opt-in through enableLoggedInCache and loggedInCacheRoles. Admin, REST, feeds, error responses, private cookies, unsafe query strings, and dynamic WooCommerce routes are excluded. WooCommerce safe mode additionally protects cart, checkout, account, Store API, wc-ajax, add-to-cart, faceted-query, and session/fragment routes.
Another plugin can set DONOTCACHEPAGE or use the documented request filter. Known unsafe requests remain fail-closed even when a broad filter is present.
Lifetime and invalidation
cacheLife is expressed in hours. A value of zero has owner-specific meaning: the file cache keeps the file until invalidation, while a server cache uses its own bounded lifetime. ttlOverrides accepts the current per-post-type values: 0, 1, 6, 12, 24, 48, or 168 hours.
Post updates normally invalidate the post, home/blog views, related archives, and derived CSS. Theme/plugin lifecycle changes, settings saves, permalink changes, and manual clears can trigger broader invalidation. The wppo_invalidation_urls filter can add a path; the before/after cache-clear actions support integrations.
Capacity and safety
Cache capacity is bounded by size and file-count settings. A randomized-query guard, stampede guard, path containment checks, and safe deletion prevent unbounded growth or unsafe paths. The Dashboard reports cache size, page count, and last clear.
Settings
| Key | Default | Purpose |
|---|---|---|
enableCache | true | Enables the cache layer. |
cacheLife | 0 | Global lifetime in hours. |
enableLoggedInCache | false | Enables role-keyed logged-in variants. |
loggedInCacheRoles | [] | Eligible roles for those variants. |
ttlOverrides | {} | Per-post-type lifetime overrides. |
wooSafeMode | true | Protects dynamic WooCommerce requests. |
Verify
wp wppo cache status
curl -sI https://example.com/ | grep -iE \'etag|last-modified|vary|x-litespeed-cache\'
wp wppo cache clear --page=/sample-page/