SSI-LM-Hack 1.0b for Apache 1.3b7 and 1.2.0/1.2.1/1.2.4

What is it all about?

The SSI-LM-Hack is a patch/replacement for the Apache module mod_include (the one providing SSI (server-side includes) features) giving Last-Modified-Dates for non-dynamic SSI documents. Please refer to the Apache documentation (e.g. at http://www.apache.org) for further info on SSI.

Why use it?

Because the Apache httpd assumes all SSI parsed documents to be dynamic it does not provide a Last-Modified: http header if such a document is requested. This is a good thing for truly dynamic pages (e.g. using #exec) as this stops most proxy and browser caches from caching the document.

But when using SSI for the sole purpose of being able to include portions of html source common to several files, the resulting documents are not really dynamic. Nonetheless the above rule applies to them as well, stopping proxies from caching the document thus increasing your server load and access times.

There are several ways to solve this problem:

How does it work?

The basic idea is to use the most recent modification date of the SSI document file itself and all included document files as the Last-Modification-Date used in the header of the HTTP response. Because the header must be output before the body an additional parse pass was necessary. During this pass all relevant SSI statements are analyzed as follows (no output is generated): After this first pass the Header including the LM date is sent. Then the normal document parsing producing output will be performed.

How do I install it?

Installing is quite easy. However, you'll have to remake the httpd executable. I assume you are familiar with this process. The following steps are necessary:

Are there any problems?

There are some points you should be aware of: SSILMHACK has been successfully used by the webserver of the Unix-AG at the University of Siegen (http://www.unix-ag.uni-siegen.de) for over 2 years with an NCSA httpd and for several months with an Apache httpd providing homepages for students at the University (http://www.stud.uni-siegen.de).

Revision History

1.0b
support for 1.3 (currently 1.3beta7)
1.0a
support for 1.2.4
1.0 had a bug when trying to use '#include file=...' to include a file that is not in the same or lower directory where the document resides. Apache forbids this include yielding an error message. SSILMHACK crashed when doing this - fixed now.
1.0
first public version

Things to do

There is much space for improvement:

Contacting the author

If you have any questions or suggestions for improvement feel free to contact me via email: Frank Thilo <thilo@unix-ag.org>

Download

Download SSILMHACK 1.0b
Frank Thilo - 2.5.98