I’m not sure if I’m doing this wrong. I’m trying to cache a query result:
$teamModel = Team::model()->cache( 100000, null, 100 )->findByAttributes( array( "team_url" => $url ) );
I’ve also tried setting a CDbCacheDependency, but the result is the same. In my log I still see the query being executed:
[sql]system.db.CDbCommand
Querying SQL: SELECT * FROM team WHERE team_url = ‘teamurl’
LIMIT 1[/sql]
then underneath:
[sql]system.caching.CApcCache
Serving "yii:dbquerymysql:host=localhost;dbname=xxx:xxx_user:SELECT
- FROM
team
t
WHEREt
.team_url
=:yp0 LIMIT
1:a:1:{s:4:":yp0";s:13:"teamurl";}" from cache[/sql]
Why is the query still being executed? What am I doing wrong?