(2002-07-09) Swartz Bake Dont Fry

Aaron Swartz: Bake, Don’t Fry. I really got started with this whole Web mess with the ArsDigita Prize where I learned how to build database-backed websites by building one myself.

Now, a number of tools are challenging that assumption. Movable Type, the program that runs this weblog, has a series of Perl scripts which are used to build your webpage, but the end result is a bunch of static pages (static site generator) which are served to the public. All the content here is plain old web pages, served up by Apache. Tinderbox uses a similar system, drawing from your database of notes to produce a bunch of static pages. My book collection pages are done this way. Radio UserLand statically generates the pages on your local computer and then “upstreams” them to your website.

Some websites. the documentation explains, are fried up for the user every time. But others are baked once and served up again and again.

Baked pages are easy to serve. You can almost always switch servers and software and they’ll still work. Plus, you get to take advantage of the great features built into your web server, like content-negotiation, caching, ETags, etc. You don’t get the bells and whistles like providing a personalized greeting on every page, but those are things that aren’t very good for you anyway.

I don’t care about performance! I care about not having to maintain cranky AOLserver, Postgres and Oracle installs. People Don't Want To Run Their Own Servers

Building Baked Sites. First, let me clarify that using static web pages for your site does not preclude things that people generally associate with dynamic sites (like templates, newsboxes, stock tickers, etc.).

The key is to keep a strict separation between input (which needs dynamic code to be processed) and output (which can usually be baked).

So how would this work? You’d need a dependency tracking system (good old GNU make might even do the job) that would allow you to add new content to the system (something tricky with make alone — is this what automake does?) or modify old content and would then rebuild the dependent pages or create new ones as necessary

Current systems (like OpenACS) could even be hoodwinked into doing this with little or no modification.

Baking doesn’t do everything, though. Input systems, like the code that accepts comments, would still need to be dynamic.


Edited:    |       |    Search Twitter for discussion