0

大家 好 是否可以在 magento 中禁用缓存 cms 页面?出于某种原因,我需要禁用 cms 页面上的缓存

4

1 回答 1

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

于 2013-09-05T12:22:23.573 回答