Summary: This error means a dynamic Edge Side Includes (ESI) block couldn’t render while the page itself was served from cache. It’s usually caused by ESI being disabled or unsupported on the server, a plugin/theme (or optimizer/WAF) rewriting the ESI request URL, or a PHP error inside the ESI subrequest. Follow the checklist below to restore proper ESI rendering for blocks like WooCommerce carts, login/account widgets, nonce-protected forms, and more.
I’m getting “Page is cached but the ESI block failed to render.” The page caches, but cart/login/nonce parts don’t load. How do I fix this in LiteSpeed Cache for WordPress?
Here’s a pragmatic, copy-paste friendly playbook that resolves the vast majority of ESI failures with LiteSpeed Cache for WordPress (LSCWP).
ESI (Edge Side Includes) lets LiteSpeed serve a cached page while pulling fresh HTML for specific blocks (e.g., cart count, login state) via a separate subrequest. If that subrequest can’t run or its URL gets mangled, LiteSpeed serves the cached shell and your ESI block “fails to render.”
X-LiteSpeed-Cache with values like hit/miss. If you never see LSCache headers, you’re likely not using a LiteSpeed/OLS+LSCache stack. In that case, disable ESI features or move to a supported stack.The most common real-world cause is an optimizer, security plugin, proxy, or WAF “tidying” the ESI subrequest URL and breaking its query string, especially turning & into & in the link itself. When that happens, LiteSpeed can’t fetch the block, so it fails.
& instead of raw &. If you see this, exclude the ESI markup/selector from the optimizer or turn off the feature that rewrites these URLs.If the subrequest hits a fatal error, the block can’t render. Use LSCWP’s tools and your PHP error log to catch this quickly:
X-LiteSpeed-Cache: hit on repeat loads and the dynamic piece (cart count/login state/nonce fields) displays correctly.Do I need ESI at all? Use it when you want most of a page cached but still need a small, dynamic fragment per user/session. If your site has few dynamic bits, you can disable ESI entirely and rely on normal uncached pages for those specific routes.
Why does this only happen on some pages? Only pages that include ESI fragments are affected. The rest of your site can cache normally.
Is this a security problem? No, it’s a rendering/routing problem. But misconfigured WAFs and optimizers often cause it.
WP Assistant is a free tool created by Atiba Software, a WordPress design and development company located in Nashville, TN. If you need more personalized WordPress assistance let us know, and we’ll get back to you ASAP!