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

Using Cache In Cactiverecord

$
0
0
I'm using cache in CActiveRecord as:

$myoboject = ListModel::model()->cache(60)->findAll();

According to documentation it caches the result set for 60 seconds.

I would like to ask, will it open a new DB connection if another request will come within 60 second ? What I think it should not do like this, instead it should fetch the cached data.

I'm having this problem because I wanted to avoid the multiple db connection being opened by a script and I want to cache the data for 60 seconds, and after that it can be invalidated.

Am I on the right track ? is this a normal behaviour ? will anybody please let me know if there is something wrong ?

I have used both Memcache and Sqlite.

Thanks

Viewing all articles
Browse latest Browse all 18717

Trending Articles



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