开发者

What is the best practice for disabling a cache request from the Full Page Cache (FPC) in magento (enterprise)

开发者 https://www.devze.com 2023-04-11 05:26 出处:网络
I wish to remove the following setting: <cms>enterprise_pagecache/processor_default</cms> ... from the config.xml of the core/ Enterprise /PageCache / config.xml file so that the home p

I wish to remove the following setting:

<cms>enterprise_pagecache/processor_default</cms>

... from the config.xml of the core / Enterprise / PageCache / config.xml file so that the home page will not be cached, (because we have a complicated custom store switch in place).

Since this value is not stored in core_config_data I am unsure of the best way to override the out of the box value. The comments above the line in the core file do hint that i开发者_运维技巧t is not actually bad practice to edit this file, however, can I open this to the community to see what they think?

PS = This is a multi website setup with a custom store switcher.


Hole punching is what it sounds like you may need.

Add a etc/cache.xml file with a <config> root to your module. (see Enterprise/PageCache/etc/cache.xml). Choose a unique [placeholder] name.

The placeholders/[placeholder]/block node value must match the class-id of your custom dynamic block, e.g. mymodule/custom

The placeholders/[placeholder]/container node value is the class to generate the content dynamically and handle block level caching

The placeholders/[placeholder]/placeholder node value is a unique string to mark the dynamic parts in the cached page

placeholders/[placeholder]/cache_lifetime is ignored, specify a block cache lifetime in the container’s _saveCache() method if needed

Implement the container class and extends Enterprise_PageCache_Model_Container_Abstract. Use _renderBlock() to return the dynamic content.

Implement the _getCacheId() method in the container to enable the block level caching. Use cookie values instead of model ids (lower cost).

One last note: You DON’T have the full Magento App at your disposal when _renderBlock() is called. Be as conservative as possible.

SOURCE: http://tweetorials.tumblr.com/post/10160075026/ee-full-page-cache-hole-punching

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号