Not to cache


I have a problem around caching.

The concrete thing:

I created a webshop using APC cache. (Works fine!:) ) I cache the product pages (and of course the price as well).

BUT! If a logged in user is a "reseller" I need to show another price to him, but it is (maybe) cached already.

How can I disable the caching when a reseller is logged in?

Thanks for your answers.

Actually I find a solution, but not the really good one.

$cacheid .= $reseller ? 1 : 0;


It works for me, because all of my resellers have the same prices, but I will not work

when each reseller will have unique prices.

So my question is still: how can I disable caching from phpcode?



if($this->beginCache('cacheName', array('cacheID' => ($reseller ? false : 'cache')))

So when $reseller is true, the $cacheID property of COutputCache will be set to false and caching should be disabled.

Don’t know if this is best solution, I’ve never used beginCache().

You’re my man. Works like a charm. Thanks a lot.