The theory versus the practice of "static websites"

July 14, 2023

A while back I read Wesley Aptekar-Cassels' There is no such thing as a static website (via) and had some hard to articulate feelings about it. As I read that article, Aptekar-Cassels argues that there is less difference between static and dynamic websites because on the one hand, a static website is more dynamic and complicated than it looks, and on the other hand, it's easier than ever before to build and operate a dynamic web site.

This is the kind of article that makes me go 'yes, but, um'. The individual points are all well argued and they lead to the conclusion, but I don't feel the conclusion is right. Ever since I read the article I've been trying to figure out how to coherently object to it. I'm not sure I have succeeded yet, but I do have some thoughts (which I'm finally pushing out to the world as this entry).

The first thought is that in practice, things look different on a long time scale. The use of static files for web content has proven extremely durable over the years. Although the specific web servers and hosts may have changed, both the static file content and the general approach of 'put your static files with .type extensions in a directory tree' has lived on basically since the beginning of the web. One pragmatic reason for this is that serving static files is both common and very efficient. Since it's commonly in demand even in dynamic websites, people who only have static files can take advantage of this. Being common and 'simple' has meant that serving only static content creates a stable site that's easy to keep operating. This is historically not the case with dynamic websites.

The second thought is that one reason for this is that static websites create a sharp boundary of responsibilities with simple, strong isolation. On the one side is all of the complexity of the static web server (which, today, involves a bunch of dynamic updates for things like HTTPS certificates). On the other side is those static files, and in the middle is some filesystem or filesystem like thing. What each side needs from the other is very limited. Any environment for dynamic websites necessarily has no such clear, small, and simple boundary between the web server and your code, and on top of that we're unlikely to ever be able to standardize on a single boundary and API for it.

(This is not an accident; the web was, in a sense, designed to serve static files.)

As a result, I believe it will always be easier to operate and to provide a static files web server than a dynamic web server and its associated environment. In turn, this makes static files web servers easier to find. This leads to the durability of static websites themselves; they're easier to operate and easier to re-home if the current operator decides to stop doing so. Or at least it leads to the durability of moderate sized or small sized static websites, ones that can fit on a single server.

This leads to my final thought, which is that the distinction between static and dynamic websites is not blurry but is in fact still quite sharp. The distinction is not about how much work is involved in building and operating the site, or how much changes on it on a regular basis (such as HTTPS certificate renewal). Instead, the distinction is about where the boundaries are and what the sides have to care about. A static website has two clear sides and draws a sharp boundary between them that allows them to be quite independent (even if they're operated by the same people, the two sides can be dealt with independently). A dynamic website has no such sharp boundaries or clear sides, although you can create them artificially by drawing lines somewhere.


Comments on this page:

I think the stability of static pages is the main reason why I prefer them. The web is really good (made for?) for transfering documents, and I think at a Static Site as juste a bunch of documents, either made by hand or with a "CMS", made available with a HTTP/S daemon.

On the other hand, dynamic website are often a pain to maintain, or migrate. If you got a PHP website in version X, you're never sure that in 5 years this version will be supported, or even available through the classical package manager (not even speaking 'bout the security and stability issues). This, for me, seems overheilming for the personnal pages, or the little groups, which can't handle big maintenance tasks on an everyday basis on the long-term.

Of course one can split the difference in a way by using a dynamic CMS for content workflow, and then have it spit out static files for serving, e.g.:

By cantelope at 2023-07-15 23:12:36:

Interesting read. This subject is in the same vein as pros vs cons of using javascript at all, and might even be the same debate. In any case, the analysis of pros vs cons out of context is meaningless. What is proper depends entirely on the intended purpose of the app. I use "app" because at the very least, we can agree that websites of all kinds are applications of varying degrees of complexity and service, be it the delivery of the barest text, or rich, interactive games and multimedia experiences. You're absolutely right on a lot of points, including the original/early design of the web. But recall that the demand for features that can only exist with CONDITIONAL LOGIC (the substance of all scripting languagws), will always be met by a supply of technology capable of interacting with a VARIETY of xontent types, languages, and environments, both front and back end.

I think the most powerful aspect of "static website" dogma, is a return to manageability and standards that make sense. As developers we've lost touch with manageability and consistency, but this isn't the fault of scripts any more than abuse of power tools is the fault of electricity. Take care in your calls to action, that they do not cut into your own figurative flesh. ;)

Re yaurtiere: "If you got a PHP website in version X, you're never sure that in 5 years this version will be supported..."

PHP has put out an annual release, supported for 3 years, for the past 8 releases. I think you can be sure it will be EOL in 5 years. A lot of languages seem to have shifted to that kind of pace.

With the shift in library support (e.g. OpenSSL 1.0 to 1.1) it can become a serious effort to rebuild a language from its 5-year-old source tarball on a modern system.

Written on 14 July 2023.
« Some notes on errno when tracing Linux kernel system call results
Static websites have a low barrier to entry »

Page tools: View Source, View Normal.
Search:
Login: Password:

Last modified: Fri Jul 14 23:00:35 2023
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.