I was a bit puzzled when I first heard the phrase "static web site". It sounded like a silly new label for something old, a marketing staple in the tech industry that usually provokes eye rolling from me. But after having a chance to try it out, and try alternatives, I have become a believer in the term, the fundamentals behind what makes it new, and it's potential for the future.
The promise of static web sites is 100% control of the code, good and cheap hosting, and total control over the tooling that makes it happen. If you are a web developer, this might sound awesome. If you are not a web developer, static web sites probably are not for you.
Static Site Generators
It's quite possible to generate a static web site using Notepad. You might also write scripts to cobble together a static site build process from generic web development tools. But there are also specific static web site generation tools targeting this use that provide features you will appreciate. A combination of Grunt and Assemble is a favorite of mine. One way or another you want to do some or all of the following:
- Format HTML page layouts
- Process LESS or SASS into CSS
- Minify and/or obfuscate code
- Compress files
- Deploy your site
There are several technology drivers behind the static web site resurgence:
- Client-side UI Frameworks - No surprise, the shifts of interactive web code from the server to the client makes custom-coded web servers less important.
- Client-side Vendors - Service providers are delivering their APIs client-side as well, allowing entire classes of formerly server-side coding to be offloaded onto providers. Examples include the vast range of web analytics vendors, forums providers, etc.
- Cloud Hosting - Many static sites are hosted on large-scale cloud storage services like Amazon S3 or Github pages, which are reliable, surprisingly fast, and cheap.
- CDNs - High performance needs will likely be met by a Content Delivery Network (CDN) anyways, and static sites are easy to ramp onto a CDN. For example, Amazon S3 is a basic static hosting tool, and also serves as a source for Amazon's CloudFront CDN.
The technology changes above are interesting, but the economic shifts they have caused are what makes static web sites so interesting:
- Blob Hosting is Cheap - Hosting costs have gone down since cloud providers like AWS, Azure, and Google have taken off. But on all cloud vendors there is a sharp distinction between the costs of running a custom web server 24x7 and the cost of static hosting on blob storage.
- Hosting Costs Proportional to Use - How much does your site cost if you have 1 visitor in a month? 1,000 visitors? 1 million? For static sites, the low-end costs are minimal, easily less than $1 per month for no traffic. Costs rise smoothly in proportion to traffic, which most of us find reasonable to fund. Custom web servers have mostly fixed costs based on the number of servers you need, which only vary if you make it vary.
- Low Maintenance - Static sites are wonderfully low on maintenance costs and labor. Custom web servers need monitoring, updates and security patches, and occasional troubleshooting.
What About Content Management Systems?
You might wonder why I have compared a static site to a custom web server, as opposed to a Content Management System (CMS) like Wordpress. Some of the same factors apply, but the decision to adopt a CMS or build a custom site feels like a precursor step based on different considerations. CMSs typically provide the following features:
- User-Friendly Interface - A user interface friendly to non-technical users that allows authoring, editing, and publishing content without coding.
- Vendor Ecosystem - CMSs come with vendors who can help you, from off the shelf themes and plugins, to custom coding consultants, to training courses and how-to books telling you how to get started. Wordpress is a monster.
- Safety - CMSs do at least an OK job at lots of things, without expert input from you, ensuring that your website looks decent, conforms to browser norms, user expectations, search engines, and best practices.
These can be critical features for individuals and companies if their needs fit the profile. But many developers start using Wordpress because they heard it was good for blogging or whatever, only later to find themselves restricted by the most celebrated CMS features. Static web sites offer a more familiar and flexible path for the web developer.
I myself have had mixed experiences with CMSs like Wordpress. Wordpress is excellent in many ways, I especially appreciate it as an authoring tool. But I have had bad experiences with crappy themes and flaky hosting providers, which left me in a position where I either spent a lot more money, dug under the hood to really learn the internals, or moved elsewhere. Today, I use a mix of both Wordpress and static sites.