Forum Moderators: coopster

Message Too Old, No Replies

PHP, include, and server strain

Does using php include increase stress on the server?

         

driven_snow

1:54 am on Jan 10, 2004 (gmt 0)

10+ Year Member



.. by much?

Say I want to use <php? include()?> so that I don't have to individually change headers and navigation etc, all over the site.

Will doing this increase the strain on the server by much?

KMxRetro

2:03 am on Jan 10, 2004 (gmt 0)

10+ Year Member



I wouldn't have thought it would cause that many problems. I do it on my site for both my headers and footers, and there is no noticable speed difference (aside from when I come to update...much quicker for me! :) )

Go for it.

coopster

2:05 pm on Jan 10, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Similar threads that may provide insight:
PHP includes -- include the content or the code? [webmasterworld.com]
rendering dynamic PHP pages [webmasterworld.com]

superpower

5:44 am on Jan 12, 2004 (gmt 0)

10+ Year Member



It should have no effect unless you are doing this a massive amount of times a second. I have tons of includes and all kinds of dynamic stuff going on for over 50,000 pages and most of my pages generate in less than .01 seconds. I include lots of things left/right, top/bottom, etc.

If your are curious in the PHP doc notes there is an example of a microtime stamp function which can compute how long your page took to generate. You can experiment with that too to see the difference.

driven_snow

4:09 pm on Jan 12, 2004 (gmt 0)

10+ Year Member



Thanks.

I've got about 150 pages, but it's moderately heavy traffic ( 50,000 monthly ) on a less than ideal server, so I was a little worried about overworking it.

I'm not worried about the time so much, it's a very light design ( <15k ), so I don't think it would be too noticeable, it's just that we aren't the only site on the server and I didn't want to end up causing problems.