大家好 是否可以在magento中禁用缓存cms页面?我出于某种原因需要在cms页面上禁用缓存
答案 0 :(得分:1)
在EE中,有3种类型的页面被缓存。 CMS页面,类别和产品。每个实体都在app/code/Core/Enterprise/PageCache/etc.xml
标记<cache><requests>
标记内的<frontend>
内定义。对于cms页面,有这一行
<cms>enterprise_pagecache/processor_default</cms>
这为cms页面设置了处理器 您需要通过在config.xml中添加一个自定义模块来禁用此缓存:
<frontend>
...<!-- other config settings here -->
<cache>
<requests>
<cms></cms><!-- this should override the cms page cache processor to null -->
</requests>
</cache>
</fronend>
让您的模块依赖于Enterprise_PageCache
模块
我没有测试过这个。如果它不起作用,您可以将缓存处理器设置为您的某个模型<cms>module/cache_processor</cms>
,并在您的类中添加应返回allowCache
的方法false
。