Welcome Guest, Not a member yet? Register   Sign In
Query caching time
#1

[eluser]Ngulo[/eluser]
hi i red the guide to cache my queries i just do :

$this->db->start_cache();

$query-> ....

$this->db->stop_cache();


but i didn't catched how to set cache time for each query i want to cache?

thanks
#2

[eluser]osci[/eluser]
You don't set cache time.

In the guide it says
Quote:Managing your Cache Files

Since cache files do not expire, you'll need to build deletion routines into your application. For example, let's say you have a blog that allows user commenting. Whenever a new comment is submitted you'll want to delete the cache files associated with the controller function that serves up your comments. You'll find two delete functions described below that help you clear data.

You have to delete the related cache queries and recreate them each time you make an update to db.
#3

[eluser]patwork[/eluser]
Well, I'm afraid you're talking about two different things. This functions are only Active Record cache, not real query results cache.

You're talking about:
http://ellislab.com/codeigniter/user-gui...ml#caching

And you should try:
http://ellislab.com/codeigniter/user-gui...ching.html

Anyway, osci is right, cache do not expire and you must delete is manually.
#4

[eluser]marcogmonteiro[/eluser]
What about html cache? In the manual you can set an expiration time. is there a function to deleted?
#5

[eluser]Ngulo[/eluser]
thanks guys yep i mistaked about Tongue
just some one knows if is out some CI lib to set query caching in time? Smile




Theme © iAndrew 2016 - Forum software by © MyBB