Forum Moderators: coopster

Message Too Old, No Replies

PHP for everything?

...is it too much of a load...

         

Emperor

8:54 pm on Nov 8, 2004 (gmt 0)

10+ Year Member



Hi guys,

My main page is done entirely in XHTML and I was thinking of adding some semi-dynamic content. A good example is a random affiliate banner; so basically the whole page is still XHTML except for that little part with the banner.

I can use JavaScript for the banner but I think 15% of people don't have it and I'm pretty good at PHP so it's better to do it that way.

Do you think it will slow the page down? What if the page gets lots of hits?

Let's say I have a page in regular XHTML and just change the extension to .php without actually adding PHP code, will that load slower than the non-PHP page?

I guess I need some general guidence.

Take care,
Cyrus

lorax

10:15 pm on Nov 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Let's say I have a page in regular XHTML and just change the extension to .php without actually adding PHP code, will that load slower than the non-PHP page?

Any time you use the PHP extension you are telling the server that file needs to be handled by the PHP engine before it gets passed to the client. SO - the server has to take the extra step of processing the page and then the webserver will deliver the page to the client. Is it slower - technically yes. Will the visitor notice - not likely.

Emperor

7:17 pm on Nov 9, 2004 (gmt 0)

10+ Year Member



Thanks man.

So if someone is at my PHP page and they click a link then click the Back button the page will not be cached right? It has to load all over again?

If that is true then PHP eliminates browser caching which can't be a good thing.

Take care,
Cyrus

mincklerstraat

7:28 pm on Nov 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



php by default doesn't send any headers with caching information, and most good browsers in that case won't cache it (they're not supposed to according to the w3c). What you need to do to get php pages to be cached is to send appropriate cache headers, like Last-modified, Expires, or Cache-control. Google 'cache headers' and you'll find the relevant ones.

freeflight2

8:23 pm on Nov 9, 2004 (gmt 0)

10+ Year Member



php precompilers such as zeus or mmcache (free and claims to be the fastest) can dramatically speed up your php scripts, making 50-70 page requests per second for extensive database driven forums, photo galleries possible