Forum Moderators: coopster
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.
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.
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.