On 12 Sep 2002 at 1:35, M1tch wrote:

> Just spent ages (well, 2hours) on a precaching system for my PHP code
> that didn't work out! Hang on, I'll backtrack a bit...
> 
> My website is using a php engine that picks at snippets of html from the
> database, and builds them up to form the page. A typical page may use 5
> of these html snippets, each at maybe 5kb in size.
> 
> I was sat thinking, looking at the debug-timer, and saw that the
> templates were one of the more time consuming aspects. So I said, I
> know, I'll save the db a bit, and at the start of the script, read all
> the templates that I'll need into a global variable, and call them from
> that. Simple, 5 db calls put into 1, and templates taken out of memory.
> 
> So why, oh why, has the time taken actually increased??? Does anyone
> have sufficient working knowledge of PHP to give me a hint at why this
> has happened?

I bet someone would have to look at the code. Are you writing your own code or just 
gluing modules together? I'm using the 
Smarty template system which I really like, it caches templates.

Personally I think you are going overboard in trying to optimize at this point. I 
assume that your system is working, and so you 
need only tweak it. But it sounds as if you are still working out what the system is. 

I have not done much work on High Traffic sites. One site was a skater site and  big 
food producer was running a promo and 
had TV ads ... site performed fine even though it was just plain cgi scripts hitting 
mysql at least 5 times for just about every 
page (I did not write the site but I had to modify,watch it).

Another site was marked as troublesome, big book publisher. They just threw hardware 
at it and all was well. 

Now Yahoo ... or Google ... that would be interesting. Why create a solution for no 
problem?  I'd suggest looking at your 
templating system. Which one are you using? You didn't create your own did you?

Peter




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to