banner
Welcome to HTML.co.uk, the number one resource for all news, information, and happenings regarding HTML.

Updates: HTML.co.uk has just been relaunched. Subscribe to our RSS Feed to stay on top of HTML news and techniques.
Nov
12th

Using SSI to Boost Efficiency

Author: Editor | Files under HTML Tutorials
Tags for this article: , , , ,

Any good and latest web designer would always want to make sites that not only look great but also are quite fast to maintain and at the same time quite easy and simple to build. Server Side Include which has always been considered to be quite complex proves to be an amazing option especially for the small sites which need not be updated on a daily basis. If SSI is used properly it can definitely reduce the time that would be invested in the creation and the maintenance of any website.

The best part about SSI is that it is supported by all major leading web server platforms such as IIS and Apache. If IIS is the web server platform that is being used by you then SSIs are automatically enabled for all the files with extensions .stml, .stm or .shtml. But in case of Apache web server platform you would need to enable the SSI manually. As you can make it out from the name only that the main function of SSI is inserting the contents or the information contained in one file into another especially when the served up. Not only this you also have the option of inserting some other information such as file sizes, including the dates of the file modification and last but not the least the values of the server environment variables.

You can use the #include directive for including or inserting one file into the output of the other file. <! — #include virtual = “ /virtual/URL/to/file” –> It’s quite possible that this virtual attribute may appear a little funny if you have ever used SSI before or for that matter worked with IIS. This should not be mistaken with the file system path to the file but instead is a URL on the local server to the file. Thereby making the SSI files easier to move around from server to server as well as on the file system. Though the file attribute is widely accepted yet virtual is the general preference. If you are still persistent in using the file, you may end up in trouble while moving your web site from the development server to the production server.

Now once the basics are done it is now time to put it into action. In order to consider a typical situation wherein you would be first developing on the local machine and then later deploying it onto the server then you would have to get on developing a local web server. As there is definitely a difference between the two servers therefore it is always advisable to use the same local web server for the development and the production machines. And just in case if you have the plans of deploying on the Apache server and currently you are operating on the Windows desktop then you will have to make sure that the web server that is being used by you is surely an Apache server. And finally enable the SSI.

It is quite surprising though that you can actually reduce the redundancy by approximately 40% just by putting the navigation, footers and headers into your SSI files. This is surely a perfect way of reducing time especially during maintenance and construction. In case if you have certain download pages that have certain items that need to be updated regularly then you can make good use of the #flastmod directive as it is capable of keeping the download pages up to date. Therefore, it can well be seen and noted that SSI is a boom for the site developers and can be widely used for increasing the efficiency.