Pass Muster Media My Social Feed

The Tech

Part 1. Only ask while someone's looking

The cheapest request is the one never made: our pages ask for fresh data only while a person can see them.

3 min read

This is the first part of Fresh when it matters. The idea is simple. If nobody is looking at a page, nothing on that page needs to be fresh.

Static first

Our pages are static files served from Cloudflare. A creator site's archive is built ahead of time, so a visitor gets every post instantly and our servers do no work at all. A page like that can be opened a million times without anyone asking Substack for anything.

What static files can't do is show something that happened five minutes ago. For that, each page tops itself up with small requests on a timer. Those top-ups are where all the care goes.

A timer for each source

On a creator site, one clock ticks every 60 seconds, and each source has its own pace:

The live lineup is the fast one because a show that started 10 minutes ago is old news. A new post can wait a few minutes. YouTube is the slowest of the three: pages ask the server for channels "no older than 10 minutes" (more on that in Part 2).

The reader at My Social Feed works the same way with its own numbers. It asks about live shows every minute, keeps the calendar it fetched for 5 minutes, and when you come back to the tab it reloads its posts if they are more than 2 minutes old.

Hidden tabs ask for nothing

Every one of those timers checks a single thing first: can anyone see this page? Browsers answer that through the Page Visibility API (document.hidden on a creator site, visibilityState in the reader). A tab in the background, or a phone in a pocket, makes no requests. The reader may still redraw what it already has in that state, but it doesn't touch the network.

When you come back, the page catches up once, right away. On a creator site that means Substack and Bluesky are refreshed the moment the tab becomes visible, instead of waiting for the next tick. The reader polls live shows the same way.

The effect: ten people with a page open in background tabs cost the same as zero.

Bluesky never touches our server

Bluesky is different, and it is the cheapest source of all. Its public API is open to browsers, so the visitor's own browser asks Bluesky directly for a writer's latest posts. The request never passes through our server. We don't pay for it, we can't be a bottleneck for it, and Bluesky sees an ordinary reader asking for one public feed. Our server never hears about it.

Substack and YouTube go through our server, because it keeps a shared copy so that one fetch can serve everyone. That is the subject of the next two parts.

Why not just poll faster?

The simple version of a live page asks everyone's sources every few seconds. It feels fresh, and it is also how a small tool turns into a big nuisance. Cost grows with the number of tabs left open overnight, not with the number of people actually reading. Ours grows with attention instead, which is a far smaller number.

What this buys

With static pages, per-source timers and a visibility check, a page's cost to the platforms is roughly "how many people are looking right now, times a few requests every few minutes." That is already small. But the server also has its own work to do, and it does that work in an order set by who is looking.

Part 1 in one line: build ahead, top up on a timer, and stop the timer when nobody's looking.

Next in the seriesPart 2. Attention sets the schedule ← All posts