yiiz
(Cnyuzhiwei)
September 5, 2010, 6:39am
1
Using the page cache, and I’ve used renderDynamic twice in the view, as follows:
the 1st
<div id="post-list">
<?php $this->renderDynamic('renderPartial', '_postlist_dynamic', array(), true); ?>
</div>
the 2nd
<div id="sidebar">
<?php $this->renderDynamic('renderPartial', '_tags', array(), true); ?>
</div>
In the ‘_postlist_dynamic’ view and ‘_tag’ view, I’ve used fragment cache. take the ‘_tag’ view as example
<?php if($this->beginCache('tb-tagCloud', array('duration'=>3600))) { ?>
<?php $this->widget('TagCloud', array(
'maxTags'=>50,
)); ?>
<?php $this->endCache();} ?>
Now the problems are:
Everything works when the page first opened(the cache is cleaned), but the next time, there is a very strange problem, the contents which should be displayed in the 2nd place is now displayed in the 1st renderDynamic, and the 2nd place now showed <###dynamic-1 ###> instead.
If remove any renderDynamic, retaining only one other, everything works.
How to fixed it?
Using the page cache, and I’ve used renderDynamic twice in the view, as follows:
the 1st
<div id="post-list">
<?php $this->renderDynamic('renderPartial', '_postlist_dynamic', array(), true); ?>
</div>
the 2nd
<div id="sidebar">
<?php $this->renderDynamic('renderPartial', '_tags', array(), true); ?>
</div>
In the ‘_postlist_dynamic’ view and ‘_tag’ view, I’ve used fragment cache. take the ‘_tag’ view as example
<?php if($this->beginCache('tb-tagCloud', array('duration'=>3600))) { ?>
<?php $this->widget('TagCloud', array(
'maxTags'=>50,
)); ?>
<?php $this->endCache();} ?>
Now the problems are:
Everything works when the page first opened(the cache is cleaned), but the next time, there is a very strange problem, the contents which should be displayed in the 2nd place is now displayed in the 1st renderDynamic, and the 2nd place now showed <###dynamic-1 ###> instead.
If remove any renderDynamic, retaining only one other, everything works.
How to fixed it?
just use different cache id like tb-tagCloud_tags and tb-tagCloud_postlist_dynamic or what ever you want in
<?php if($this->beginCache('tb-tagCloud', array('duration'=>3600))) { ?>
mdomba
(Maurizio Domba Cerin)
September 15, 2010, 10:04am
3
This is solved in the trunk (Yii 1.1.5)…