Server Side Includes
Server Side Includes, SSI, are directives placed in an HTML document. These directives are processed by the server prior to delivery of the document to the viewer. SSI can be used for a variety of purposes:
- Including the content of another file in the HTML document.
- Running a CGI script on the server and incorporating its results in the HTML document.
- Returning information regarding file size, last modification date, local time on the server...etc.
The generic form of an SSI directive is <!-- #tag argument="value" -->. The tag values supported by the Apache webserver are discussed below.
Needless to say, the webserver needs to be told to parse HTML documents and execute SSI directives before sending the document on to the viewer. This is done by using a special extension for all HTML documents containing such directives. The most frequently used extension .SHTML. Depending on the type of server you are using you may be able to use .htaccess to specify another extension.
SSI offers a simple technique for customizing HTML page content without executing CGI scripts. The fact that the webserver itself handles SSI, as opposed to executing an external application to run the CGI script, can make SSI faster for delivering relatively simple page customization. However, it should be borne in mind that SSI does involve an overhead - the need to parse each HTML document for the presence of directives.