Forum Moderators: coopster

Message Too Old, No Replies

which is more efficient PHP or SSI

new to both and need a direction to go in

         

icpooreman

3:13 pm on Jul 10, 2005 (gmt 0)

10+ Year Member



Hey I'm building this website and there are four parts of the site I want to be the same on every page (header, footer, menubar, news section). Now I'm about to expand this site from a couple of pages to 50-60 (currently static) pages and I don't want to have to change all of those pages for example every time I change a link in my menubar.

Now I know I can do this with Server Side Includes but I'm also hearing I can do this with php. My question is which is more efficient. Efficiency being measured by speed and how much processing power it will take up on my server. I don't want to change my html pages to .shtml or .php and I've been doing research and I'm hearing that SSI's will eat up my servers CPU when doing this because my server will have to parse every .html file. Does anyone know if that's the case and wouldn't that be the case if I used php as well.

Also if I could just get some general feedback on what you would use in this situation I'd be very grateful. I'm somewhat new to both and I need a direction to go in so I can plan out my site.

abbeyvet

3:54 pm on Jul 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Any includes require server-side processing, whether SSI or PHP, so there is nothing much between them on that front.

There is a server load from this, but while this was an issue when servers were way less powerful and fast than they are now, unless you are serving huge numbers of pages daily it is not really going to be a major one now.

Using includes also creates a delay, generally so short as to be inperceptable, when loading pagess into a browser, since they must be parsed. I doubt anyone would notice it would be so marginal.

The advantage of using includes in most cases easily negates these disadvantages.

On which to chose - for me one advantage of PHP is that it allows you to do much more in your pages than just add includes, you can incorporate all kinds of functionality. For that reason I tend to favour PHP even if this is not an issue at the outset, it may be that it will be later, and its nice to have things already set up and ready to cope with changed plans.

icpooreman

3:55 pm on Jul 10, 2005 (gmt 0)

10+ Year Member



also another question I forgot to ask is how will using either php or SSI's effect how search engines parse my site. Will they simply ignore the external file or will they go into it and parse through it.

jatar_k

3:55 pm on Jul 10, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



if we talk about simply including conent then they are fairly equal in that regard.

PHP is much more powerful and going forward will allow to do endless things with it.

You don't need to change the extensions on your pages, you can leave them as html and just turn on php parsing for that file extension either in httpd.conf or in htaccess.

>> because my server will have to parse every .html file

it is negligible, php or ssi will do the same. If you have an include in the majority of your files anyway you will want it to parse everything.

<added>how will using either php or SSI's effect how search engines parse my site

it won't matter, all they will see is the final output, the include happens on the server side when someone requests a page, when they receive the page it is already constructed. To see what the search engine sees, just view source on the page.