journal features
movie reviews
photo of the day

scripting for site management

the journal of Michael Werneburg

twenty-seven years and one million words

Kokubunji, 2021.08.09

I use scripts to support the content management system that I wrote to create and serve this website. I realized I was doing something silly with the automated job that flattens the website*. I had a routine that runs daily. It's a Perl** script that prepped a query and called the PHP page within the application server that generates the content. Why not just build the content right from the Perl script? As I was doing that, I recalled the taste of Python I had at a former employer. Now I'm thinking of rewriting all of it in Python. I've been looking at the "frameworks" for such a thing, thinking something that does less and leaves me to do what I want seems my speed.

*Flattening a website is a technique as old as the hills. The trick is to generate the HTML page from the application engine, and write that to the filesystem so that the front-end webserver can quickly respond to queries by sending the pre-made HTML file. It's a trick that was simultaneously understood and deployed all over the place in the Web 1.0 days. I dreamed it up myself one day when at the tiny Internet company that was hosting the site of the Sydney Olympics. We simply couldn't satisfy the demand by running the traffic at the clunky content management system, which couldn't build the HTML fast enough.

**I'm old.

rand()m quote

Between two evils, I always pick the one I never tried before.

—Mae West