如何在TinyBrick的Lightspeed中为Magento设置打孔 [英] How do I setup Hole Punching in TinyBrick's Lightspeed for Magento
问题描述
我正在使用TinyBrick的Lightspeed 模块进行整页缓存,并尝试设置打孔.
I am using TinyBrick's Lightspeed module for whole page caching and am trying to setup Hole Punching.
I'm following the directions at: http://blog.delorumcommerce.com/general/90-percent-lightspeed-traffic-fast-but-i-need-more
我已经编辑了模板的header.phtml,使其包含摘要:
I have edited my template's header.phtml so that it contains the snippet:
<!-- TEST HOLE PUNCH -->
<!-- NOCACHE key="topMenuLinks" -->
<?php echo $this->getChildHtml('topCart') ?>
<!-- ENDNOCACHE -->
<!-- END TEST HOLE PUNCH -->
如果我访问购物车中没有任何内容的页面,则会显示购物车元素,其中带有TEST HOLE PUNCH
注释,但已删除NOCACHE
.
If I visit a page with nothing in my cart the shopping cart element is displayed, with the TEST HOLE PUNCH
comments, but with NOCACHE
removed.
如果我在服务器上查看页面的缓存文件,我可以看到它同时包含TEST HOLE PUNCH
和NOCACHE
注释,并且如果我使用?debug_front=1
查看该页面,我会看到:
If I view the page's cache file on the server I can see that it contains both the TEST HOLE PUNCH
and NOCACHE
comments, and if I view the page with ?debug_front=1
I see:
success!, I'm about to spit out a cached page, look out.
这似乎按预期运行,但是如果我将商品添加到购物车中,则?debug_front=1
答复:
This seems to be functioning as expected, but if I add an item to the cart ?debug_front=1
replies:
disqualified with cart
valid disqualifiers without hole punch content... bummer
查看页面源仍显示TEST HOLE PUNCH
注释,但不显示NOCACHE
注释.购物车元素周围可以准确报告购物车中的商品数量
Viewing the page source still shows the TEST HOLE PUNCH
comment, but not the NOCACHE
comment. Surrounding a shopping cart element that accurately reports the number of items in carts
据我了解的博客文章,我应该看到一个空白区域,其中NOCACHE
注释被TEST HOLE PUNCH
注释包围.
As I understand the blog post, I should be seeing a blank spot where the NOCACHE
comments were surrounded by the TEST HOLE PUNCH
comments.
阅读"valid disqualifiers without hole punch content... bummer"
后,我认为可能是失败了,因为我没有尝试填补漏洞.
After reading "valid disqualifiers without hole punch content... bummer"
I thought it might be failing because I didn't attempt to fill the hole.
我使用示例代码添加了一个控制器,并且能够导航到/lightspeedcontent/hole/index
并看到:
I added a controller using the example code and am able to navigate to /lightspeedcontent/hole/index
and see:
{"topMenuLinks":"Hello World!"}
然后我编辑了catalog.xml
和cms.xml
,以便所有<action method="cachePage">
都包含:
And I edited my catalog.xml
and cms.xml
so that all <action method="cachePage">
contain:
<holecontent>lightspeedcontent/hole/index</holecontent>
但是,当访问购物车中有无物品的页面时,我得到相同的结果.
But I get the same results when visiting the pages with or without items in the cart.
任何人都有使用此模块的经验吗?帮助将不胜感激.
Does anyone have experience with this module? Help would be greatly appreciated.
推荐答案
我遇到了同样的问题,但是我只是让打孔在顶部链接上工作,即它显示"Hello World!".而不是链接.我所做的唯一更改是在cms.xml和catalog.xml中的"disqualifiers"标签中,删除了除"loggedin"以外的所有内容,因此,现在当我登录并返回首页时,它会显示"Hello World!".信息.
I encountered the same problem, but I just got Hole Punching to work on the top links, i.e. it displays 'Hello World!' instead of the links. The only change I made is in the cms.xml and catalog.xml, in the 'disqualifiers' tag I removed everything except 'loggedin' so now when I log in and go back to the home page it displays the 'Hello World!' message.
我意识到这个答案有点晚了,但它可能会帮助其他人进行搜索.
I realise that this answer is a bit late but it might help someone else searching.
这篇关于如何在TinyBrick的Lightspeed中为Magento设置打孔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!