Web pages can be very simple, containing a little mark-up that helps inform the software receiving and rendering the page a little bit about its content and how it should be presented, ideally with the help of cascading style sheets (CSS) to provide styling information. However, sometimes that simplicity isn’t enough, and a web page might need to refer to external resources. There are a number of ways this can be done, and one is by using Server Side Includes (SSI). When a page is being passed from the server to the client, they are parsed to identify any Server Side Include statements, and when any are found they are acted on, and replaced with the result of doing so.
A simple example of an SSI would be to display the date of the file itself, so that whenever you load the page a part of the information you see is the date it was last uploaded or updated. This might help you to decide whether or not to read any further – if it’s dated several years ago, the information might be out of date, or you may have read it in March, but can see that it was updated in April, so could be worth another read.
Thomas Milius has written a piece of software called SSI to run alongside web server software and provide a server side include function – and has adapted his own web server, HTTPServ, to recognise and act on its presence if necessary. Both pieces of software can be downloaded from the ‘Computer activities’ section of his website, or a copy of HTTPServ that includes SSI can be fetched from !Store. An example is included that displays a simple chessboard, to demonstrate how HTTPServ can use SSI to access BBC BASIC.
The specific implementations of server side includes can vary, and Thomas’ is no exception to this, but it is loosely based on the W3C Jigsaw SSI documentation.