February 09, 2005

The Three Levels of Dynamic Web-Publishing

  1. The "MySQL" Level

    This is where you store pre-made pages in a database, or just on the server in flat files. The pages are created when you enter text in a form window and click "Publish". They then get merged into a template.

    Your server thus publishes each page once. This "server" is not necessarily the web server. Once stored, the web server gives the same file to everybody that comes looking for it.

  2. The "PHP" Level

    This is where your templates are written in PHP, so they pull in information whenever somebody visits your page. The actual pages that people see don't exist, but once they download to the browser, they're made of the same HTML as those at Level 1.

    Your web server published each page, each time somebody requests it. Only the template and the "items" remain untouched.

  3. The "JavaScript" Level

    This is where your templates are filled in by the web browser. Your pages contain bits of script that load dynamic images, check the time and date, ask for the user's name, things like that. The templates, with the script inside, are stored statically on the web server.

    Your web server doesn't do much: the user's web browser runs the javascript that pulls in all the dynamic content. The javascript might call your web server for help, but it doesn't have to. Your user's computer does all the work.

Levels 1. and 3. potentially put the least load on your web server. In level 1., all the pages are pre-processed; in level 3., your user's computer does the processing. That said, level 2. can be the most flexible, because you can pull in dynamic content every time every user sees a page, and you can also access resources that you installed yourself. So in level 2. for example, you can install a special font on your web server, and you can work it so that all your pages are viewed in that special font. In level 3., you have to rely on the fonts that the user has installed on their machine.

No comments: