2014-05-22 40 views
3

我最近安装了清漆3.X系统(Ubuntu的),并将其配置为8080Magento的孔PUCH清漆

现在全页面缓存已启用,其工作的罚款。我只想忽略页面的某些 特定动态块。我怎么能用magento做。此外,我不是 使用Magentos默认缓存技术,所以我禁用它。也试过模块松节油

感谢&都把layout.xml文件

拉杰什Ganjeer

+0

问题不清楚,你要关闭缓存为特定的块或者希望禁用块? –

+0

是的,我想关闭特定块的缓存。请建议..这是紧迫的要求,但没有得到任何帮助.. –

+1

您是否使用扩展来启用Magento中的Varnish支持,或者您刚才在Web服务器前安装了Varnish?禁用Magento的块缓存将不起任何作用,因为Varnish(默认情况下)将缓存任何输出。要实施打孔,您需要研究Edge Side Includes。这些基本上允许您独立控制页面块的缓存策略。有几个扩展可以正确实现。 – rbaker86

回答

6

我已经这样做了使用

试试这个在应用程序/设计/前端内local.xml中/ XXX/XXX /布局/ 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>` 

OR

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

OR

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

OR

整页会忽略缓存如。一个页面模块checkout_onepage_index

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

我试过这个使用模块Nexcessnet松节油。和它的作品

对于松节油安装后您参考:

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

非常感谢您的反馈。

参考网站:

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

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

感谢&问候

拉杰什Ganjeer

0

试试这个:如果你想在PHTML文件来禁用然后使用块名称后假

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

像这样:

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

如果你wan t禁用PHP文件,然后使用此代码在特定的块类:

public function getCacheLifetime() { return null; } 

希望这会有所帮助。祝一切顺利!

+1

这只会影响Magento的块缓存。清漆缓存不会被这种方式清除。 – rbaker86

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>