The page in question contains LOTS (too many for my liking) SQL queries (it is a highly modified oscom. site, mod rewrite etc) I have JUST turned SQL Query caching on. Using fairly common techniques to determine page generation time - Get the time at the VERY beginning of a PHP script Get the time at the VERY end of a php script Work out the diff. My sites home page has page generation times of about .150 seconds. This is under fairly low load. Is this figure in itself alarming or reassuring of...? Secondly: I was thinking about cutting the number of queries down (even though now I am using query caching) as I am wanting to optimise further. I was thinking of storing in an array at the beginning of every page request the most required fields in the products (2000+ rows) and categories (100+ rows) tables (most common tables required throughout most pages). These couple of queries would then be stored in the query cache for later use on other pages/by other users etc. Then during the rest of the page generation/processing, rather than my MANY queries accessing the query cache I would just query the couple of stored arrays (products, categories) and query out of the array the required data at that particular point in time. This would happen many times over in the page. So rather than having multiple (many multiple) hits on the DB or query cache I would be parsing these decent size (large??) arrays (2000+ records max) multiple (many multiple) times in the one page. Would such be faster than accessing the query cache or would it be negligible and thus probably not worth the time in re-coding and accessing the arrays? I know in doing so I could probably reduce the number of hits on the query (cache) by up to 80-90%. Hope this all makes sense.
Do you really need all that information on every page though? It seems to use a bit more memory then required by any web application I have ever seen.
You might want to look into doing SQL joins - you can usually combine two or more queries into one that way. Did that with one of my sites and cut down the queries dramatically. 0.15s is ok for a DB intensive page though I'd say. Are you on a dedicated server, DB host, etc?
On a dedicated server (for me), I've got a couple of other sites running on it though - all fairly low intensity. Pale, agree wouldn't need to do the query I mentioned on every page, but would only do it on the pages that I required it.