Problem Using Fragment Cache, And Coutputcache Duration

Hello, Im using Yii 1.08

Im trying to set up a feature on my site to allow content admins to view an uncached copy of a page under certain conditions. The viewfile uses the CBaseController::beginCache() function, and the only property Im passing in for the 2nd argument is ‘duration’. This is then passed to a COutputCache widget, where ‘duration’ is documented such that a value of 0 removes existing cached content, and a negative integer disables the cache (for that request).

I have CMemCache as my application cache class, and typically dont experience many problems with memcache except in this one circumstance.

Firstly, I chose to pass in a very low duration, 5 seconds. The cache seems to hold for many minutes. Disabling cache via application configuration allows the db to get hit and produce the correct data, and reenabling the cache brings the stale data back. After many minutes, perhaps more than 5, the cache eventually clears. If I pass 0 for ‘duration’ in beginCache(), or a negative number (-1), the same behavior as 5 seconds is exhibited. If I dont pass in a duration, and leave it to the default value of 60, it seems to expire as expected (after 60 seconds). I cant seem to figure out the cause for this.

Im only using framework level components at this point. My controllers dont override beginCache, and Im just using the framework COutputCache and CMemCache classes.

Id like to vary the value of duration to disable the cache as documented, but the data stays stale for many minutes when I use a number lower than the default value for duration, and I cant figure out why. Since this all occurs in the framework, I am unsure what I am doing wrong. When I add logging throughout the entire process, from beginCache to endCache, and throughout all the functions involved between COutputCache, CMemCache, and CCache, it appears to fail to find cached data in COutputCache::init(), yet stale data is returned. Could anyone help me understand this process, and perhaps shed light on what im missing?

Thanks