Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Querying Instead Cache?

$
0
0
This is (shorter) table structure:

- id
- name
- last_date

This is code:

            $dependency = new CDbCacheDependency('SELECT MAX(last_date) FROM table WHERE id='.$id); 
            $post= Post::model()->cache(3600, $dependency)->findByPk($id);



Using CWebLogRoute I see:

02:17:50.937169 trace system.db.CDbCommand

Querying SQL: Select t.id, t.name, blabla FROM post blabla


02:17:50.937511 trace system.db.CDbCommand

select max(date) from post where id=blabla


02:17:50.938518 trace system.caching.CApcCache

Serving... bla bla (this is from cache)


Why do I have these frist system.db.CDbCommand?

Tnx

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>