Web Engine - UnrealTower

I wrote a pretty decent web engine for this site, by combining Apache 2 the webserver, CherryPy as the engine's framework, and Cheetah, a template engine.

The result is an easily extendible, powerful engine for this website. One of the major features that is not found in most dynamic websites, is that the UnrealTower engine reports the last modification date of the pages. This ensures that browsers and proxies can effectively cache the site, and that search engines know when something has been updated.

Configurable client-side caching

The modification time/date is reported in the ``Modified'' HTTP response header. This causes the browser to use an ``If-Modified-Since'' request for the next time the page is requested, displaying it from cache if it hasn't been changed. The modification time/date reported is the compile time of the template, but can also be given by a function, for example to give the time/date of the latest news item on a news page.

This is augmented by a configurable maximum time the page will reside in a cache. This way, fairly static pages like this one can be cached for days, whereas a changing page like the news page can be updated frequently.

Easy to add new page templates

The basic page templates are just HTML with only a few extra lines for the templating system.

Server-side caching

The engine imports the compiled template into memory upon the first request, and serves it from memory until it is reloaded or altered. This cuts down on reading and parsing time.

Automatic menu system

The menu system automatically opens the correct section for each page. The menu itself is stored in a simple Python file. This makes extending the website trivially easy.