Intranet Journal Intranet FAQ
Answers
to Questions about...
Web Servers
11. What are Server Side Includes (SSI)?
When you need to patch a small section of
on-the-fly content into an otherwise static page, CGI is a heavy-handed
solution. An alternative almost as widely supported as CGI is server-side
includes (SSI), which allow you to "include" dynamic content
into web pages using special HTML tags.
SSI tags have the form:
<!--#command argument="value" -->
Details of the command set and syntax are documented
online in the original NCSA tutorial. Apacheweek also maintains
a good
how-to article.
Performance
impact. Unlike standard HTML, which is parsed and rendered
by a web browser after the page has been served, SSI tags are parsed
on the server (hence, "server-side includes"). Finding
and parsing these tags can slow server response, so webmasters
typically specify which files contain SSI tags by using a unique
file extension, such as .shtml or .shtm.
This is done by adding a line to the MIME content type definition:
AddType text/x-server-parsed-html .shtml
Only files with this MIME type will be parsed by the server.
Note:
Like CGI, SSI is a first-generation Web technology and suffers many
of the same drawbacks. It is best used to implement simple page dynamics
on Unix servers. Sites built on Microsoft Internet Information
Server (IIS) should consider using its bundled scripting technology,
ASP.