Single file website

An idea

Problem

Websites are becoming complex. To load a page the browser usually issues several HTTP requests. It takes time, especially on mobile where latency is the most limiting factor.

Idea

What if instead building web pages from many files delivered one by one we would combine all them into one? That way the browser only needs to download one thing.

I’m drawn to the idea because of the simplicity of it. And I wonder how hard would it be to maintain a site like that.

An example

Derek Sivers is actually already doing it already. 

The design is minimalistic and readable. Forces one to pay attention only to his writing and to nothing else.

One HTTP request delivers whole content.

The only page where he actually uses an external file is on the blog post page. The small JavaScript file loads the comments.

Advantages

The advantages of such approach are:

  • Simplicity. There’s no need to manage a lot of dependencies. To make sure everything compiles and loads at the right time. 


  • Only one request. Makes your web page/site fast. It will be more noticeable on 3G networks, where latency is a key limiting factor. 


  • The page itself will be (or at least, should be) fast to use. Single file limits the number of unnecessary things one can stick in there. 


  • No need to worry about the content showing up without styles or JavaScript. It’s all bounded up within the HTML document. Everything shows up at the same time.

Disadvantages

  • Only makes sense for either content focused websites or small single page applications. 


  • No browser cache. By sticking to one file, there’s no chance to take advantage of the browser cache. With the advent of single page applications, that’s becoming less relevant. 


  • The lack of tooling. As far as I know there are no dedicated tools to help to maintain such a solution. But given the simplicity of it shouldn’t be too hard to create something. 



Conclusion

The idea of single file website appeals to me also from an aesthetical point of view. The constraints of a single file and also reasonable size forces one to be creative.