Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why can it be a bad idea to set-up Apache to parse all html files for SSI?

SSI (Server Side Includes)

Why can it be a bad idea to set-up Apache to parse all html files for SSI?

by  Wullie  Posted    (Edited  )
This explains why it can be a bad idea to set-up Apache to parse all html files for SSI.

When you set up Apache with the default configuration and enable SSI, the server parses only .shtml files for SSI. This is for a very good reason and you should be aware of this if you decide to change it.

When a .shtml file is called, Apache looks for and parses any SSI directives that are contained within. If you alter the httpd.conf and change this so that Apache should also parse .html files then you may run into serious problems.

Parsing a file for SSI uses more system resources than calling a html file normally and this keeps the server usage to a minimum.

When you change this, every .html and .shtml file called by a browser results in Apache having to check the file for any SSI directives, regardless of whether the file may contain them or not.

The problem with this is that on a server that receives a decent amount of hits, the server usage goes way up and you are wasting resources for no reason. On a small server with a few hits a day you may not notice any difference but as you go up the scale, the server usage gets greater and the time taken for Apache to deliver the pages to the browser gets greater.

If your host enabled this and you personally did not do it, you stuck with .shtml files, you may think that you will not be affected. You could not be more wrong.

Even though no .html pages on your site contain SSI, the pages are still parsed for it, as they are on the rest of the server. This process affects the whole server and not just the webmasters that use this.

If you do decide to do this for a site, be sensible and enable it on a per domain basis so as not to run the risk of your server collapsing at high traffic times.

You can enable this either in your httpd.conf or in a htaccess file contained within the domain in question.

Hope this helps

Wullie

sales@freshlookdesign.co.uk
www.freshlookdesign.co.uk
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top