Coutputcache & Header

Hello everyone,

I’im using COutputCache and I just wonder how can I refresh cache when user is logged and when user clicks “Logout”? I think there is a better way instead of saving and removing users in a table.



Also, I would like to know how can I update my blog post (example). There is a column "total_views", and If my page is cached, how can I do:




It’s not possible, because blog post is cached.

Thanks again.

Consider using "Dynamic Content".

I would not use query caching for a single record. It doesn’t seem very effective to me, considering the overhead of dependency management.

But if I ever have to use it, I will probably create a separate table for total_views.

Thank you very much.

Well it’s better because of that I’ve one table with about 7 left joins, so it’s recommended. It’s not problem to create a seperate table but where to execute a query? Whole page is cached (COutputCache).

Where do execute:

$st = SeperateTable::model()->findByPk($id);



? Thanks.

So, you may consider using “Dynamic Content”. :)

Lol, my mistake. But now the problem is that Yii returns: