One of the newest features that has been added to web servers is that of Server-Side Includes or SSI. SSI is a set of functions built into web servers that give HTML developers the ability to insert data into HTML documents using special directives. This means that you can have dynamic documents without needing to create full CGI programs.
The inserted information can take the form of a local file or a file referenced by a URL. You can also include information from a limited set of variables-similar to environmental variables. Finally, you can execute programs that can insert text into the document.
Note The only real difference between CGI programs and SSI programs is that CGI programs must output an HTTP header as their first line of output. See "HTTP Headers" in Chapter 19, "What Is CGI?," for more information.
Most Web servers need the file extension to be changed from html to shtml in order for the server to know that it needs to look for Server-Side directives. The file extension is dependent on server configuration, but shtml is a common choice.
All SSI directives look like HTML comments within a document. This way, the SSI directives will simply be ignored on Web servers that do not support them.
Below is partial list of SSI directives supported by the many servers. Not all Web servers will support all of the directives in the table. You need to check the documentation of your web server to determine what directives it will support.
SSI provides a fairly rich set of features to the programmer. You might use SSI if you had an existing set of documents to which you wanted to add modification dates. You might also have a file you want to include in a number of your pages-perhaps to act as a header or footer. You could just use the SSI include command on each of those pages, instead of copying the document into each page manually. When available, Server-Side Includes provide a good way to make simple pages more interesting.
Before Server-Side Includes were available, a CGI program was needed in order to automatically generate the last modification date text or to add a generic footer to all pages.
Your particular web server might have additional directives that you can use. Check the documentation that came with it for more information.
Further INFO: If you'd like more information about Server-Side Includes, check out the following Web site: http://www.sigma.net/tdunn/ which has documents detailing some of the more technical aspects of Web sites.
Disadvantage of SSI There is one down side of Server-Side Includes. They are very processor intensive. If you don't have a high-powered computer running your web server and you expect to have a lot of traffic, you might want to limit the number of documents that use Server-Side Includes.