0

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?

2
  • What happens if you do the same with Env variables in the htaccess instead of in the index.php file?
    – mbalparda
    Jul 16, 2016 at 16:29
  • @mbalparda thank you for helping me out. Its fixed!
    – Diwaker
    Jul 18, 2016 at 14:38

1 Answer 1

3

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.

5
  • thank you for specifying the different syntax between V3 and V4. In my case it turned out to be a broken php code in footer section. which was probably the cause of ESI processing not enabled error. As Varnish was seeing a invalid xml. So I have added esi_disable_xml_check to varnish config also.
    – Diwaker
    Jul 18, 2016 at 14:34
  • great, you can mark this answer as a solution then ;)
    – MagenX
    Jul 18, 2016 at 18:13
  • I tried to upvote ur answer but its not doing the trick as I have less than 15 points. Is there any other way?
    – Diwaker
    Jul 19, 2016 at 21:20
  • i think you can mark this as answer no matter how many points you have, this was your question.
    – MagenX
    Jul 20, 2016 at 12:15
  • Already did. It will not show publicly until I earn 15 reputation points. It's recorded though.
    – Diwaker
    Jul 20, 2016 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.