Issues With Cfilecache

We’re on Rackspace and I noticed that after extensive caching, the “compute cycles” was pretty much the same.

Looking into it, I noticed that the modified time on the cache files are 363 days in the past (17-Oct-2011). My cache is set for 48 hours. Is this normal? My first thought was that this was the issue, but according to the debug

trace all the queries are being cached properly. Strange…

The other thing I’m wondering about is this, from CFileCache.php:




protected function getValue($key)

{

  $cacheFile = $this->getCacheFile($key);

  

  if ( ($time=@filemtime($cacheFile)) > time() )

    return @file_get_contents($cacheFile);

  else if ( $time > 0 )

    @unlink($cacheFile);

  

  return false;

}



Is it just me, or does the [font=“Courier New”]filemtime($cacheFile) > time()[/font] part look odd? Wouldn’t it always be false, as the modified time of the file would never be greater that the current time? Or am I just having brain farts?

This must by answered by dev team, so consider posting this in Yii Bugs forum.

But I agree with you, that at least at first sight, this does look strange. And yes – it seems that this if will always return false.