Issue with LiteSpeed Cache ESI causing duplication and rendering problems
-
Hello,
I hope this message finds you well. I am currently facing an issue with LiteSpeed Cache and its ESI (Edge Side Includes) functionality. I am using WordPress with Breakdance Builder and WooCommerce, and I have implemented LiteSpeed Cache to cache the entire website.
The specific problem arises on the “Single Product” and “Products Archive” pages, where I have conditional text that changes based on the time of day. Before 12:00, one text is displayed, and after 12:00, another is shown. Caching these URLs causes an issue as the cached content doesn’t update with the correct time, leading me to explore the ESI feature.
I have created a shortcode that utilizes ESI, like this:
[esi myshortcode]
. The shortcode successfully retrieves the desired text based on the time of day. However, I am encountering two main issues:- Duplication: Occasionally, the page renders with duplicated content, appearing twice in a stack.
- Incorrect Rendering: In some instances, instead of rendering the shortcode, the entire HTML of the page is displayed within the shortcode.
I have observed a peculiar message, “nonce_ajax:5c12a891cf,” on the product page during some occurrences.
Notably, when I insert the ESI shortcode on a blank page (containing only header and footer), it functions correctly without any issues. My question is: Is there a way to exclude this specific element from caching, allowing the rest of the page to be cached effectively?
Here is working fine: https://menajeando.online/esi-blocks/
Report number: MJAAGAYD
Any insights or suggestions to troubleshoot and resolve this matter would be greatly appreciated.
Thank you in advance for your assistance.
Best regards,
The page I need help with: [log in to see the link]
- The topic ‘Issue with LiteSpeed Cache ESI causing duplication and rendering problems’ is closed to new replies.