Question

I am trying to hole punch a Magento having two websites setup for retail and wholesale with Varnish 4. So far I have fixed the header section not appearing error by fixing the Main Navigation provided by Smartwave Porto theme. But on wholesale site for Home page and Category pages header seems to work fine. But the product detail page shows ESI processing not enabled error in place of global_messages, messages and top.links block.

I have already tried solutions suggested in some other threads like -p esi_syntax=0x2

Technology Specifications are: CentOs6, Nginx, Varnish 4, Magento 1.9.

It seems like the Turpentine extensions' EsiController->getBlock() method is not returning a proper response to varnish or may be these ESI blocks are not getting parsed at all. How can I debug further?

The multi-store setup works based on the below changes made to index.php file:

switch($_SERVER['HTTP_HOST']) {
    case 'dev.domain.com':
    case 'www.dev.domain.com':
        $mageRunCode = 'retail_shop_code';
        $mageRunType = 'website';
    break;
    case 'shop.domain.com':
    case 'www.shop.domain.com':
        $mageRunCode = 'wholesale_shop_code';
        $mageRunType = 'website';
    break;
}

Mage::run($mageRunCode, $mageRunType);

Just may be above code has something to do with varnish not processing ESI correctly?

Was it helpful?

Solution

Varnish 4 does not support -p esi_syntax=, instead you have to use -p feature=

-p feature=+esi_disable_xml_check,+esi_ignore_other_elements

esi_disable_xml_check, "Don't check of body looks like XML", "Allow ESI processing on any kind of object"

esi_ignore_other_elements, "Ignore non-esi XML-elements","Allows syntax errors in the XML"

ESI processing not enabled error is related to php/template error, opcode cache issues, or your layout files in wrong place/read order.

try to change settings per block reference in turpentine_esi.xml or in store layout file directly, it can be esi|ajax method also.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top