sozo-design/Magento2_PureChat

Module is not cacheable so I can't enable full page caching using Varnish

Closed this issue · 3 comments

yeevy commented

Hi,

I've tried to enable Varnish on a Magento 2 site but the homepage reports it's not cacheable due to some blocks being set as cacheable=false

This is the output of the PureChat block:

[1]=> object(Magento\Framework\View\Layout\Element)#902 (1) { 
            ["@attributes"]=> array(6) { 
            ["class"]=> string(27) "Sozo\PureChat\Block\Display" 
            ["name"]=> string(16) "purechat.chat.js" ["as"]=> string(16) "purechat_chat_js" 
            ["template"]=> string(32) "Sozo_PureChat::chat/widget.phtml" ["after"]=> string(1) "-" 
            ["cacheable"]=> string(5) "false" } } 

Apparently you need to rely on Knockout JS to get a cacheable block which has dynamic elements.

Would this be possible to implement for this module?

Hi Yeevy,

We've had a similar issue reported on another module are in the process of fixing it. It will be updated on this module as well. I expect it to be updated before the end of the week.

yeevy commented

Thanks for the quick reply, that's great to hear! I'll keep an eye out for this 👍

Pushed version v1.0.1 of the module which fixes the issue