|
|
| |
What are Server Side Includes?
Server Side Includes (SSIs) are directives, embedded in your html document
as comments, that are executed by the web server. The results
of each directive is included, in-line, in the document returned
to your browser. Example:
| |
<!--#flastmod virtual="rtmf.shtml"-->
|
|
| |
Would return something like:
| |
Tuesday, 14-Apr-1998 10:54:05 British Summer Time
|
|
| |
There are six basic SSI directives and Apache eXtented SSIs (XSSI) adds two
additional directives plus conditional execution of SSI directives.
Why use SSIs
There are several advantages to using SSIs in your html documents.
- You can use SSIs to include a standard header, footer and/or navigation
information in your web documents. If you at some later date want to change
the layout or navigation of your site, you alter the header, footer, or navigation
files and all your documents will then be served with your new style. All the pages
in the Apache RTFM use a standard header and footer.
- You can incorporate the results of a program in your document.
- In many cases, SSIs can be quicker to implement that CGI programs.
There are several disadvantages to using SSIs
- Like CGIs, SSIs can potentially create a security breach in your web server. Any
command which is available to a general user on you operating system could be included
in as an SSI.
- SSIs increase the load on your server. When SSIs are enabled for a file, Apache
must read the entire file looking for SSI directives and execute them.
- You have to learn something new! This may be the greatest deterrent to you using
SSIs.
|
|