The Search for a Lighter Web: The Gemini Protocol
Lastmod: 2021-08-04

In a recent project I was working on a back-end service (my happy place). Eventually it came time to do some integration testing and I had to compile the front end. When I ran npm install, to my surprise, npm downloaded no less than thirty thousand packages.

Thirty Thousand.

For a Single Page Application.

The app looked great, to be clear. And I want to also clarify that I don’t think this reflects on the front-end developer, in my experience this is pretty standard. Rather, this reveals a deeper issue about the state of the World Wide Web. I could harp on why the web should be smaller and all my major and minor gripes with its current state, but I think the issue is illustrated enough by the example. It’s too heavy. Javascript and frameworks and trackers and ads and media all make for web pages which are pretty, but often obfuscate the content you actually are there to consume.

I’ve been aware of this problem with the web (among others) for some time, but I how do you even begin to looking into an issue with something so central to how you use computers? The first thing that you need to do is identify the duality of the web. There are two major categories of websites: The Application Web and The Document Web. The application web is those sites which need to be responsive: things like social media, maps, online games, etc. The document web is those sites which do not need to be responsive; they’re more static-content driven: wikis, dictionaries, blogs, most small-business websites, etc. Currently the document-web and the application web are built using the same tech in spite of being radically different in use case and requirements. Enter the Gemini protocol.

The Gemini protocol is a web protocol designed to be privacy-centric but more importantly simple. Let’s break that down a bit more. It’s privacy-centric in that it

  • Requires TLS.
  • Makes heavy use of Trust On First Use (TOFU) certificate validation, which is more democratic.
  • Does not support trackers.

Gemini is simple in several ways:

  • The protocol itself is simple: it can be implemented in <100 LOC in Python
  • The Gemini file format it delivers is simple: style is left up to the client generally and pages can be read easily in plaintext.
  • The file format also specifies each line has a type (header, link, text, etc) which can be determined by the first two bytes of the line, making it very easy to parse.
  • The content is simple; no client side code or mixed media.

The term “simple” here should not be confused with plain; Gemini sites can still be powerful. They are enabled to require input in order to serve content, so sites like search engines, dictionaries, and wikis can use this. Additionally, a server may request a client certificate as an identity and use it to create a session, allowing persistent personalized content. A server can also respond with any mime type it desires, not just text/gemini, allowing the support for PDFs, HTML, LaTeX, non-utf8 encodings, etc. When visiting a gemini site you’ll see what most would consider plain websites, but this is simply because there is little-to-no fluff on one particular category of the web.

My experience using Gemini has been very pleasant. I feel that when I’m browsing the Gemini space the content I’m reading is a bit more personal; someone cared about it being simple. I believe many of the people hosting content come from a similar background to me (software engineering or adjacent) and so a lot of the content I find is of interest to me. I also generally feel that I have an easier time reading things in the Gemini space without getting distracted. I think it’s fair to say that’s in part due to the simplicity of the sites. Also, input and client certificates can be required in the protocol so there are still applications in the space and even private applications. There just aren’t many yet.

There are still things that it can do

As the space grows I hope more people find it of interest. I highly recommend checking out more in the links below and consider hosting your own content on Gemini! I’ll be migrating (possibly mirroring instead) this blog to Gemini in the next few months. Be the change you want to see in the world. I want to see lighter websites (among other things ;P)

Gemini Homepage

Gemini FAQ

Gemini clients list (not exhaustive)