相关疑难解决方法(0)

尝试通过Magento的整页缓存获得动态内容

我正在使用Magento Enterprise 1.10.1.1,需要在我们的产品页面上获取一些动态内容.我在块中插入当前时间以快速查看它是否正常工作,但似乎无法通过整页缓存.

我尝试过各种各样的实现:

http://tweetorials.tumblr.com/post/10160075026/ee-full-page-cache-hole-punching http://oggettoweb.com/blog/customizations-compatible-magento-full-page-cache/ http:/ /magentophp.blogspot.com/2011/02/magento-enterprise-full-page-caching.html

欢迎任何解决方案,想法,评论和建议.

这是我的代码:

应用程序/代码/本地/菲/示例/ etc/config.xml中

<?xml version="1.0"?>
<config>
    <modules>
        <Fido_Example>
            <version>0.1.0</version>
        </Fido_Example>
    </modules>
    <global>
        <blocks>
            <fido_example>
                <class>Fido_Example_Block</class>
            </fido_example>     
        </blocks>
    </global>
</config>
Run Code Online (Sandbox Code Playgroud)

应用程序/代码/本地/菲/示例/ etc/cache.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <placeholders>
        <fido_example>
            <block>fido_example/view</block>
            <name>example</name>
            <placeholder>CACHE_TEST</placeholder>
            <container>Fido_Example_Model_Container_Cachetest</container>
            <cache_lifetime>86400</cache_lifetime>
        </fido_example>
    </placeholders>
</config>
Run Code Online (Sandbox Code Playgroud)

应用程序/代码/本地/菲/实施例/块/ View.php

<?php

class Fido_Example_Block_View extends Mage_Core_Block_Template
{
    private $message;
    private $att;

    protected function createMessage($msg) {
        $this->message = $msg;
    }

    public function receiveMessage() {
        if($this->message != '') {
            return $this->message;
        } 
        else {
            $this->createMessage('Hello World');
            return …
Run Code Online (Sandbox Code Playgroud)

enterprise caching magento hole-punching

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

caching ×1

enterprise ×1

hole-punching ×1

magento ×1