Caching - Renderdynamic Not Work


I’m working with cache component of Yii. I searched around but it seems there isn’t anyone encountered this problem before. The problem is renderDynamic doesn’t work outside the beginCache/ endCache block.

My situation is: I cached a form. If users first come to the form, I’ll pull it out from cache. After users submit the form, I want to display/ render the form freshly from view (because I want to display users’ data in fields again). The problem occurs here, renderDynamic doesn’t work.

Is there any solution for this problem?

Hi Hieu Vo,

renderDynamic should be used inside the cached block.

And, IMO, it’s not a good idea to use cache for user input forms.

Hi softark,

Thanks for your answer. Actually I’m building a web application which collects users’ opinions massively. The input forms will be displayed very frequently, so the ability to cache them is rather important. Is there any ways for this caching problem?

Hmmm, I’ve never thought of that kind of use cases …

I also would like to hear opinions from other people. :)