3

I recently installed the varnish 3.x in system (ubuntu) and configured it to 8080.

Now full page caching is enabled and its working fine. I just want to ignore some specific dynamic blocks of the page. How can i do with magento. Also i am not using Magentos default caching techniques so i disabled it. also tried module Terpentine

Thanks & Regard

Rajesh Ganjeer

4

4 回答 4

6

我已经使用

在 app/design/frontend/XXX/XXX/layout/local.xml 文件中的 local.xml 中试试这个:

<reference name="block name">
    <action method="setEsiOptions">
        <params>
            <access>private</access>
            <flush_events>
                <wishlist_item_save_after/>
                <wishlist_item_delete_after/>
                <sales_quote_save_after/>
                </flush_events>
        </params>
    </action>
</reference>`

或者

<reference name="block name">
    <action method="setEsiOptions">
        <params>
            <access>private</access>
            <ttl>0</ttl>
        </params>
    </action>
</reference>`

或者

<reference name="block name">
<action method="setEsiOptions">
    <params>
        <access>private</access>
        <method>ajax</method>
    </params>
</action>
</reference>`

或者

整个页面将忽略缓存,例如。一页模块 checkout_onepage_index

<checkout_onepage_index>
    <turpentine_cache_flag value="0"/>
</checkout_onepage_index>

我使用模块 Nexcessnet Turpentine 进行了尝试。它有效

供您在安装松节油后参考:

应用程序/设计/前端/基础/默认/布局/turpentine_esi.xml

非常感谢您的反馈。

参考网站:

http://www.magentocommerce.com/magento-connect/turpentine-varnish-cache.html

https://github.com/nexcess/magento-turpentine

感谢和问候

拉杰什·甘吉尔

于 2014-05-28T07:29:56.423 回答
1

按照此开始到结束清漆解决方案

http://rajeshganjeer.wordpress.com/2014/05/28/varnish-with-magento-terpentine/

于 2014-06-03T08:38:15.480 回答
0

Try this in layout.xml file:

 <reference name="block name">
      <action method="setCacheLifetime"><s>null</s></action>
  </reference>

if you want to disable in phtml file then use false after block name like this:

<?php echo $this->getChildHtml('topLinks',false) ?> 

and if you want to disable from php file then use this code in specific Block class:

public function getCacheLifetime() { return null; } 

Hope this helps. All the best!

于 2014-05-22T13:37:52.397 回答
0

使用松节油将是要走的路。

您正在寻找的具体链接是: https ://github.com/nexcess/magento-turpentine/wiki/ESI_Cache_Policy

细节是:

如果未指定,则默认 ttl 有点复杂:如果访问是私有的,那么如果方法是 ajax,则默认 ttl 为 0(不缓存),否则使用默认的 cookie 过期时间。如果访问是全局的,则使用默认页面 TTL(无论方法如何)。

实现如下:

<reference name="block name">
    <action method="setEsiOptions">
        <params>
            <access>private</access>
            <ttl>0</ttl>
        </params>
    </action>
</reference>
于 2015-08-28T00:54:04.040 回答