Query Caching Question

I’m using MemCache trying to cache a query:

$cache = new CDbCacheDependency("SELECT row_update_time FROM myTable WHERE url = '$url' LIMIT 1");

$model = MyModel::model()->cache(1000, $cache)->findByAttributes(array("url" => $url));

Looking at the Application log I see a message


"yii:dbquerymysql:host=xxx.xxx.xxx;dbname=db:dbuser:SELECT *

FROM `myTable` `t` WHERE `t`.`url`=:yp0 LIMIT

1:a:1:{s:4:":yp0";s:13:"sandbox";}" to cache

Now if I reload this page, shouldn’t it say that it’s retrieving something from cache at some point? I just says that it’s saving it to cache each time, I assume this is not correct behavior, but what am I missing?

Many thanks!

Is there a way that I can check what is actually being cached and where?

it says it all in profile and trace… to understand cache better ,start to caching into file first, it should be saved in runtime

Thanks! That’s a great idea, then the files should appear in /protected/runtime/cache/ correct? Thing is I see in the trace that it’s being saved to cache each time, but it never seems to read it from cache.