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
Saving
"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!