Fixing slow Firefox loading when using Pi-Hole

I run Pi-Hole to prevent clients on my network from loading dangerous or gross things like advertisements or tracking scripts. This normally works great: it functions on all devices without requiring configuration and I don’t need to think about it too often.

I’ve also been using Firefox a lot more often lately, partly because Big Sur introduced a lot of Safari regressions and sites like Twitter are broken regularly, and partly because I like the features it’s coming out with like HTTPS-only mode.

Unfortunately, Firefox and Pi-Hole do not play nicely together when it comes to certain websites. For example, when loading sfchronicle.com several of its trackers have performance issues:

A graph of timings for a network request. The first is 'Blocked' with 5.11 seconds. After this, staggered after Blocked, is 'DNS Resolution' which shows a 1.01 second timing. The rest are 0 seconds: connecting, TLS setup, sending, waiting and receiving.

When Firefox comes across a host which resolves to 0.0.0.0, it appears to have some kind of internal retry mechanism that, combined with HTML’s sequential loading of scripts, causes a cascading set of delays making loading take an extremely long time.

Fortunately, Pi-Hole’s behavior of returning 0.0.0.0 for disallowed hosts is configurable. Changing its BLOCKINGMODE to NODATA changes the resolution behavior from:

$ dig +noall +question +answer secure.quantserve.com
;secure.quantserve.com.		IN	A
secure.quantserve.com.	2	IN	A	0.0.0.0

to:

$ dig +noall +question +answer secure.quantserve.com
;secure.quantserve.com.		IN	A

Instead of providing an IP address, the response we get is instead that there are no A records for the domain, and Firefox gives up a lot faster, taking a few milliseconds instead of a few seconds. The Pi-Hole documentation on blocking modes provides a caveat:

…experiments suggest that clients may try to resolve blocked domains more often compared to NULL blocking…

The default blocking behavior (NULL) is returning 0.0.0.0. I have not come across any issues with this change, but I also don’t think I’d notice if DNS requests drastically increased on my network.

This doesn’t resolve all of the performance issues on the SF Chronicle in Firefox. Even using a non-Pi-Hole DNS server shows significant loading delays compared to Safari. This, at least, makes it painful instead of frustrating. As an aside, I am resentful that I’m paying $12 per month for a website that wants to inject the scummiest of Taboola-level ads on me.

More quotes

First, from The Dragonbone Chair:

“Ko muhuhok na mik aqa nop, we say in Yiqanuc: ‘When it falls on your head, then you are knowing it is a rock.’”

“‘Mikmok hanno so gijiq,’ we say in Yiqanuc!” Binabik called. “‘If you wish to carry a hungry weasel in your pocket, it is your choice!”

A ponderous one from The Banished of Muirwood:

Your mind is your predicament. It wants to be free of change. Free of pain, free of the obligations of life and death. But change is law and no amount of pretending will alter that reality.

One that made me cry from Artemis:

“What’s up, Dad? You’re slow as snot today.”

“Just being thorough.”

“Are you kidding? I’ve seen you fire up a torch with one hand and set mixture levels with the other at the same time. Why are you—”

Oh. I stopped talking. This wasn’t a normal job. Tomorrow, his daughter’s life would rely on the quality of these welds. It slowly dawned on me that, to him, this was the most critical project he’d ever done. He would accept nothing short of his absolute best. And if that meant taking all day, so be it. I stood back and let him work. After more fastidious double checks, he got started. I assisted and did what I was told. We may have our friction, but when it came to welding he was the master and I was the apprentice. Very few people get a chance to quantify how much their father loves them. But I did. The job should have taken forty-five minutes, but Dad spent three and a half hours on it. My father loves me 366 percent more than he loves anything else. Good to know.

One that makes me ponder from City of Miracles:

What a tremendous sin impatience is, he thinks. It blinds us to the moment before us, and it is only when that moment has passed that we look back and see it was full of treasures.

One that made me laugh from Gardens of the Moon:

“It will be a fine day for a walk, pronounces Kruppe, who is wise in all things.”

Kruppe (of course)

And finally one that reminds me enough of San Francisco that I couldn’t help but stop and think from The City Stained Red:

This city is sick, his father had once told him. It eats people and craps out gold and people pick the filth up off the city streets and shove it in their faces and smear it on their lips.

I created iosfontsizes.com, a quick way to glance at the dynamic type sizes Apple predefines. It’s an evolution of a Gist I created which I’ve been referring to for years, but now with the added benefit of an extremely memorable URL.

Robert Jackson Bennett, author of City of Stairs, wrote author notes for the book:

Every once in a while – mostly due to reader comments – I find myself wondering if the present tense is worth writing in. But the opening sequence to this chapter dispels any such thoughts from my mind.

Seriously, I forgot how fucking creepy Jukov is.

Standard Notes gains file attachments

Standard Notes is an end-to-end encrypted notes syncing application built for longevity:

Our revolutionary, paradigm-shifting 21st-century business plan is to keep your information ready for the 22nd century. The notes you write now should be there for you in a 100 years. That’s our killer app.

It’s one of the rare times when I value function over form. It’s an ugly application, feeling wholly unnative and lacking in important things like keyboard shortcuts. Why keep using it? There’s no other service that can sync my notes with zero knowledge across devices.

One of the bigger holes–not being able to attach and sync files–is partially filled today with the release of FileSafe:

When you use FileSafe, you attach files[…]to your individual notes. These files are then encrypted by Standard Notes offline (client-side) first, then uploaded in their encrypted form to your Dropbox, Google Drive, or WebDAV compliant server (Nextcloud, ownCloud, Seafile, Synology, and others).

It’s barebones. You can upload to a note and download from a note. There’s no previews, no inlining. It doesn’t work on mobile yet. It’s not what you would expect out of attaching a file to a note.

Privacy is such a strong differentiator.

AT&T’s ’70s video on Unix

This documentary/ad from AT&T in the 1970s has Bell Labs employees introduce and describe how Unix differs from other operating systems, as well as about the ethos of Unix. Related is the Computerphile interviews with Brian Kernighan who participated in this era of Bell Labs (and this video quite excellently).

It’s impressive how they managed to build so much fundamental concepts and designs in such a short period of time. Much of the computing world is still based on how those original Unix programs were written and the decisions of those working in Bell Labs.

Tinier webpages

The Style Guide for Google’s open-source projects includes some interesting recommendations that I hadn’t seen before, including:

For file size optimization and scannability purposes, consider omitting optional tags. The HTML5 specification defines what tags can be omitted.

This includes tags like <html>, <head>, and <body> as well as closing tags for elements like </li> and </p>. The difference can be rather stark. An extremely basic page may look like:

<!DOCTYPE html>
<title>A page about nothing</title>
<h1>Introduction</h1>
<p>Also the conclusion.

ICANN created a history project documenting its formation nineteen years ago. I’m captivated by the interviews: corralling support and preventing disputes between so many interests seems like an impossible task. I couldn’t imagine the current political climate would come close to breaking something away from the US government with such bipartisan support. Their policies are downright ridiculous at times, but their history is certainly rich.