mosonyi
(Mosonyi)
1
Hi,
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.
mosonyi
(Mosonyi)
2
Actually I find a solution, but not the really good one.
$cacheid .= $reseller ? 1 : 0;
if($this->beginCache($cacheid,...
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?
Thanks
Y11
(Y!!)
3
Try
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().
mosonyi
(Mosonyi)
4
You’re my man. Works like a charm. Thanks a lot.