A File Format For Static Websites

What Is A Static Page?

GET /hypertext/WWW/TheProject.html HTTP/1.1
Host: info.cern.ch
HTTP/1.1 200 OK
Date: Tue, 04 Apr 2017 22:25:34 GMT
Server: Apache
Last-Modified: Thu, 03 Dec 1992 08:37:20 GMT
ETag: "40521e06-8a9-291e721905000"
Accept-Ranges: bytes
Content-Length: 2217
Connection: close
Content-Type: text/html
<HEADER>
<TITLE>The World Wide Web project</TITLE>
... (obsolete HTML continues...)
  1. path: where the file is stored on the server.
  2. headers: instructions the web browser needs to decode the content.
  3. body: the data.
<HEADER>
<TITLE>The World Wide Web project</TITLE>
... (more really-old HTML stuff)
  1. Produce static pages
  2. Write the static pages to files
  3. Upload the files to a website

The Price Of Files

The Solution: In-Memory Website

  • All static website generators can output static websites. At HuffPostData I coded a couple of site generators: hpd-asset-pipeline and hpd-page-generator.
  • You can store a static website in a file and load it later.
  • You can upload a static website to a hosting service like S3.
  • You can modify a static website — for instance, add ETags or gzip-compress.
  • You can develop a static website using a development server that re-runs your framework every time a file changes. (My NodeJS development server even makes the browser refresh, with LiveReload.) The development server can mimic S3 almost exactly.
  • You can stream a static website, if it’s too large to fit in memory. And if you must, you can always stream it into filesystem files.
  • You can mix and match programming languages: pipe a StaticWebsite from your Ruby site generator to your Node S3 uploader.

--

--

--

Journalist, ex software engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Why I Love TDD And Why I’m Looking For Ways To Go Beyond TDD — Alex Bunardzic

Systems Thinking — Upgrades

How to install an SSL Certificate on GlassFish?

Writing a bash script to quickly compile C++ code for Codeforces and CSES

Automatic Schema Synchronization in NDB Cluster 8.0: Part 1

Introduction to SLAM

Robust Python with Type Hints

Postlab adds Premiere Pro, and more.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam Hooper

Adam Hooper

Journalist, ex software engineer

More from Medium

What is Git & Github?Why we use it..?

How to make Wildcard SSL Certificate in Apache in Encrypt/Certbot on CentOS?

How to create my first Open Source project

Github Branching