Adventures with SSI

File testssi.shtm

Lets see the default errmsg; it may end with a linefeed!
<!--#include file="nofile0" -->
<!--#flastmod file="testssi.shtm" --> <!--#fsize file="testssi.shtm" -->
testssi.shtm size ←See default timefmt and sizefmt.

<!--#config errmsg="Unable to parse <b>SSI-1</b>" --> ←Change errmsg.
<!--#config timefmt="%Y-%m-%d %H:%M:%S" --> ←Set date format--use dashes.
<!--#set var="pagedate" value="${LAST_MODIFIED}"--> ←Set server variable of testssi.shtm date.
<script type="text/javascript"> var jspagedate = '<!--#echo var="LAST_MODIFIED"-->';</script> ←Set javascript variable of testssi.shtm date.
<!--#echo var="LAST_MODIFIED" --> ←See date with dashes.
<!--#include file="nofile1" --> ←Check and compare errmsg.
<!--#include file="testssi.htm" -->

File testssi.shtm

<!--#include file="nofile2" --> ←Did errmsg remain changed "-2" or restored "-1".
<!--#include file="testssi.xls" -->

File testssi.shtm

<!--#include file="nofile2" --> ←Did errmsg remain changed "-2" or restored "-1".
<!--#include file="testssi2.shtm"-->

File testssi.shtm

<!--#include file="nofile3" --> ←Did errmsg remain changed "-3" or restored.

<!--#config sizefmt="bytes" -->
<!--#fsize file="testssi.shtm" --> size of testssi.shtm

<!--#config sizefmt="abbrev" -->
<!--#fsize file="testssi.shtm" --> size of testssi.shtm

<!--#flastmod file="testssi.htm" --> testssi.htm ←Note which date format is being used.
<!--#flastmod file="testssi.shtm" --> testssi.shtm
<!--#config timefmt="%Y--%m--%d %H:%M:%S" --> ←Set date format--use double dashes.
<!--#flastmod file="testssi2.shtm" --> testssi2.shtm>
<!--#printenv -->

<!--#echo var="AUTH_TYPE" -->
<!--#echo var="CONTENT_LENGTH" -->
<!--#echo var="CONTENT_TYPE" -->
<!--#echo var="DATE_GMT" -->
<!--#echo var="DATE_LOCAL" -->
<!--#echo var="DOCUMENT_NAME" -->
<!--#echo var="DOCUMENT_PATH_INFO" -->
<!--#echo var="DOCUMENT_ROOT" -->
<!--#echo var="DOCUMENT_URI" -->
<!--#echo var="GATEWAY_INTERFACE" -->
<!--#echo var="HTTP_CACHE_CONTROL" -->
<!--#echo var="HTTP_CONNECTION" -->
<!--#echo var="HTTP_COOKIE" -->
<!--#echo var="HTTP_HOST" -->
<!--#echo var="HTTP_REFERRER" -->
<!--#echo var="HTTP_USER_AGENT" -->
<!--#echo var="HTTPS" -->
<!--#echo var="INSTANCE_ID" -->
<!--#echo var="INSTANCE_META_PATH" -->
<!--#echo var="LAST_MODIFIED" -->
<!--#echo var="LOCOL_ADDR" -->
<!--#echo var="LOGON_USER" -->
<!--#echo var="PATH" -->
<!--#echo var="PATH_INFO" -->
<!--#echo var="PATH_TRANSLATED" -->
<!--#echo var="QUERY_STRING" -->
<!--#echo var="QUERY_STRING_UNESCAPED" -->
<!--#echo var="REMOTE_ADDR" -->
<!--#echo var="REMOTE_HOST" -->
<!--#echo var="REMOTE_IDENT" -->
<!--#echo var="REMOTE_PORT" -->
<!--#echo var="REQUEST_METHOD" -->
<!--#echo var="REMOTE_USER" -->
<!--#echo var="REQUEST_URI" -->
<!--#echo var="SCRIPT_FILENAME" -->
<!--#echo var="SCRIPT_NAME" -->
<!--#echo var="SERVER_ADDR" -->
<!--#echo var="SERVER_ADMIN" -->
<!--#echo var="SERVER_NAME" -->
<!--#echo var="SERVER_PORT" -->
<!--#echo var="SERVER_PROTOCOL" -->
<!--#echo var="SERVER_SIGNATURE" -->
<!--#echo var="SERVER_SOFTWARE" -->
<!--#echo var="TZ" -->
<!--#echo var="UNIQUE_ID" -->
<!--#echo var="USER_NAME" -->

Discoveries of using SSI with Apache 1.3 on MPE and Microsoft-IIS/6.0

  1. Apache - Default errmsg: [an error occurred while processing this directive]
    MS IIS - Default errmsg: Error processing SSI file
    (linefeed included)

  2. Apache - Default timefmt: "%A %B %d %Y"
    MS IIS - same.

  3. Apache - Default sizefmt: abbrev
    MS IIS - same.

  4. Apache - supports SSI elements: #printenv #set
    MS IIS - DOES NOT support SSI elements: #printenv #set

  5. Apache - ONLY files with SSI extensions (shtm) are processed for SSI commands.
    MS IIS - ALL included files are processed for SSI commands.

  6. Apache - errmsg is a local setting for each included file.
    MS IIS - errmsg is a global setting for all included files.

  7. Apache - sizefmt=abbrev includes unit letter: k m
    MS IIS - sizefmt=abbrev has NO unit letter

  8. Apache - timefmt is a local setting for each included file.
    MS IIS - same.

  9. Apache - var LAST_MODIFIED in an included file is of the requested page.
    MS IIS - var LAST_MODIFIED in an included file is of the included file.

These default and differing functionalities may be server configurable.
With the use of javascript, you may be able to code around the unsupported features.
The above example uses javascript variable jspagedate to get the LAST_MODIFIED
date of the requested page to use in an include file.

SSI also has #if #elif #else #endif for making dynamic decisions in page rendering.
But I have not yet tested them.
Keven Miller