02 October 2003 Blog Home : October 2003 : Permalink
When one looks at the web browsers in use today the overwhelming majority are capable of performing significant local processing, however the majority of web sites make little if any use of this capability. This is something that irritates me intensely. One of the biggest uses of the web is to serve up families of static pages; that is to say pages where some of the content is different but much od the page is shared - headers, sidebars etc. The classic example of this is a weblog or message board where each article has different content but the links along the side are the same. At present most weblog software creates static pages on the server based on a template or, in the case of message board software, each message is stored in a database and the message content is dynamically added to the template when the page is requested by a viewer using something like SSI or PHP.
Moreover it is wasteful of resources, since the viewer's browser and computer can almost certainly handle the construction of the page given the parts as well. Not to mention the fact that modern browsers use CSS and Javascript in a consistent, standards based way and have done so for some years now. In the late 1990s we saw much innovation in HTML and the like, but the pace of innovation, as far as standard browser technology is concerned, has practically ground to a halt in the last few years. While there are undoubtedly bugs and quirks in various browser's capability ot handle the more esoteric sorts of Javascript or CSS, the core is common to all.
While CSS, which separates display and layout information from content is deployed to some extent, very few sites make constructive use of Javascript, which has found itself in a niche used mainly by advertisers and those of malicious intent.
This weblog uses the user's browser to dynamically generate the required page from a simple HTML template page and a number of Javascript files that contain the content. The files used are as follows:
As well as reducing the load on the server and probably the load on the network between viewer and server, this approach makes the publishing process comparitively simple, since adding an entry merely means that a new value must be placed at the top of the entries array in mane.js and the entry itself uploaded. Both these actions are trivially easy to perform in perl and both can performed simultaneously in the same script. By uploading the content file first and only uploading the new mane.js once this file has been verified to have been uploaded. As and when comments are permitted the same applies, each comment is simply appended to the comment array within the relevant entry .js file.
Share and Enjoy