Splitting Code Between Multiple SSI
February 6, 2006 3:53 PM
Subscribe
What are the negative consequences of placing Web page HTML code into multiple SSI files?
There is a proposal at my work to use numerous server side includes (SSI) for all aspects of the HTML code in an individual Web page, except for three areas which the Web publishers need to customize (i.e.: the metadata, some side bar navigation, and the main content area). Our supervisor is thrilled, because this proposal is being presented as a "content management solution".
The proposal goes something like this: The DOCTYPE, opening HTML and head tags, and some global metadata would end up in the first SSI file. The CSS link reference and close of the head in a second SSI file. Since the opening body may or may not need to be customized with onload or other commands, this tag would not be in a SSI. The third SSI file would contain: an embedded SSI statement for the existing header and the opening code to define the structure of the page. The forth SSI file would contain the closing code and the opening code for the transition between the side bar navigation and the main content area. The fifth SSI file would contain the closing code for the page layout structure, an embedded SSI statement for the existing footer information, and all the remaining closing tags for the HTML document.
* Is there a point of diminishing return to using numerous SSI statements in one Web page?
* Will pages with 5 or more SSI statements load faster for the user - due to caching? Or does the page still need to process all the code (whether in an SSI file or not) before finishing the page rendering?
* Are there technical reasons to not put opening HTML code in one SSI and closing HTML code in another SSI file? (i.e.: can all browsers handle this?)
* Can comments be added inside the SSI statement (e.g.: something like "do not more or remove this SSI statement" before or after the file reference information)?
posted by chase to computers & internet (15 comments total)
1 user marked this as a favorite
It's "SSI" because this happens on the server side. The browser is irrelevant, excepting when your SSIs build something incoherent. It depends upon your server how the SSIs will affect performance, particularly with regard to any caching that it does. I'd just put a comment before the include.
There'll probably be someone who will come along and give you more complete and up-to-date info. I've been five years since doing this sort of thing. But I'd advise you to take a look at the relevant HTTP specs about SSIs, and the corresponding documentation for your particular server.
posted by Ethereal Bligh at 4:04 PM on February 6, 2006