PDA

View Full Version : Optimizing CMS


rootnik
15 Oct 2006, 18:48
Please look at my dev site:

http://dev.friendcodes.com/

You can see that I have 3 queries in that left column that will be called on all non-forum pages.

"Latest Headlines"
"DSigner Images"
"Recent Posts"

Would be be easier on the server to run a cron job every 5 minutes that would write a "static" file that would then be included in the php, instead of calling the database 3 times per page load?

Razasharp
16 Oct 2006, 05:00
If it's accessed more than once every 5 minutes... then I'd say yes.

rootnik
22 Oct 2006, 02:46
If it's accessed more than once every 5 minutes... then I'd say yes.
I have set up a caching system for my home made CMS, and will post results once my dev site goes live.

The caching script makes several queries to the database and writes them to an .html file every 5 minutes. I then use PHP's output buffering in my php scripts, instead of using the template system.

I'm being selective on what queries I cache, because I am sure that the small ones are probably faster to run in real time than using the output buffering.