PDA

View Full Version : Optimizing CMS


rootnik
10-15-2006, 04:48 PM
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
10-16-2006, 03:00 AM
If it's accessed more than once every 5 minutes... then I'd say yes.

rootnik
10-22-2006, 12:46 AM
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.