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

Also, am I right in thinking that as the website hits increase, the db will
be put under increasing pressure, so it serves off better being called only
once instead of 5 times (Even though more data is taken out of it??).

It's late, my eyes are blurring, and I'm annoyed. Very annoyed!


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to