How to know when to use database caching.

#1
[eluser]gwerner[/eluser]
I'm running into a situation where I need to run a query on every page load of a web site. This query really is only doing a check to see if a status has been updated. If it has, then display a message. I'd say that the status will normally be off probably 70% of the time. However, I will still need to check every page load.

Right now I have it setup to autoload the model and I do the call from MY_Controller. Is this the right opportunity to set this up as a cached query? It seems like it might, but I'm not certain when one should implement caching. My understanding is that if a status is updated, I would use that update to clear the cache. That way the next page load will create a new query a recache the data.

Does turning on caching for one query create more of a load than just loading the model and doing the query?

So, should I query every page or cache the query? Thanks in advance for any help.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.