nexcess / magento-turpentine

A Varnish extension for Magento.
GNU General Public License v2.0
519 stars 253 forks source link

Need some advice to implement two block with turpentine ESI #1457

Open sandrinecrozat opened 6 years ago

sandrinecrozat commented 6 years ago

Hi,

On our product page (ex here: https://www.label-emmaus.co/fr/briquet-prince-dolphin-grave-toyota-motor-toyota-corona-n08317-japan-13644981) we have 2 blocs that we try to make faster using ESI.

First One - Title : "Options de livraison"

We get a json from external API and parse it in php. The API respond between 300 and 500ms. So we want to use ESI to define a long TTL.

<block type="catalog/product_view" name="product.shipping_options" as="shipping_options" template="catalog/product/view/shipping_options.phtml">
                    <action method="setEsiOptions">
                        <params>
                            <method>esi</method>
                            <access>public</access>
                            <ttl>10800</ttl>
                        </params>
                    </action>
                </block>

But page is very slow (about 2 sec.).

Questions :

Second One - titre "A propos du vendeur"

                <block type="catalog/product_view" name="product.merchant_infos" as="merchant_infos" template="catalog/product/view/merchant_infos.phtml">
                    <action method="setEsiOptions">
                        <params>
                            <method>esi</method>
                            <access>public</access>
                            <ttl>10800</ttl>
                        </params>
                    </action>
                </block>

This block can be the same between several product page (same merchant). How can I generate only one bloc for each merchant and not one for each product ? We try to use registry_key but without success...

Thanks per advance for your help and sorry for my bad english.

sandrinecrozat commented 6 years ago

Update : we change method to use ajax on first block. User experience is better.