How to Enable ESI Hole Punching in LiteSpeed Cache on cPanel
Posted about 3 months ago 3.7kWhat is ESI Hole Punching
Dynamic caching: Cache full page but serve personalized content.
LiteSpeed ESI Support
Enterprise feature – allows caching pages with dynamic widgets (cart, login).
Enable ESI in Plugin
LiteSpeed Cache → Cache → ESI tab → Enable ESI.
Implementation Examples
WooCommerce Cart Widget
Use LSCache ESI nonce for cart count and mini-cart.
Custom ESI Block
<!--esi on-->
<?php echo do_shortcode('[dynamic_content]'); ?>
<!--esi off-->
ESI Use Cases Table
| Use Case | Benefit |
|---|---|
| Cart widget | Always current count |
| User login status | Personalized greeting |
| Dynamic ads | Targeted content |
| Comments | Fresh comments on cached page |