View Single Post
Old 01-27-2008, 05:41 PM   #3 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

There are a number of levels of cache that you might want to think about implementing, each with their own particular advantages. I won't go through all of the different tiers but just highlight some. You could cache an entire rendered page and essentially serve it as static content, which would obviously be hugely beneficial but only if that's a usable situation -- eg. this is not possible if user-data ("Hello Salathe") is on the page.

You could cache particular portions of rendered HTML, maybe for sections that might be especially resource/time intensive but is pretty static (like lots of SQL queries for a sidebar, perhaps).

You could also cache database results meaning that for those cached queries/result-sets the time/memory needed to talk to the database and get back the results can be negated.

Another thing to ask, is caching really all that important a thing to implement right now for your application? Twenty-five well written queries isn't really such a terrible thing to worry about. But if you were worried then perhaps instead of, or along side, caching you could think about optimising and/or reducing the number of database queries.
Salathe is offline  
Reply With Quote
The Following 2 Users Say Thank You to Salathe For This Useful Post:
Brook (01-27-2008), danielneri (01-27-2008)