RC RANDOM CHAOS

Datasette Stops Firefox From Prefetching Unnecessary Pages

· via Simon Willison

Original source

datasette #3046: Don't serve link: rel=next HTTP headers to Firefox for HTML pages

Simon Willison →

Datasette serves HTTP link headers to signal pagination to browsers, but Firefox interprets these headers as prefetch instructions and automatically loads subsequent pages. This creates unnecessary network overhead and server strain, as most visitors never click through to the next result set, leaving prefetched content wasted.

Willison discovered this inefficiency by monitoring Firefox’s network activity and traced it to a 24-year-old Firefox bug governing this prefetch behavior. The fix, labeled datasette #3046, modifies the application to withhold link headers when serving to Firefox specifically, while preserving them for other browsers that don’t trigger automatic prefetching.

The discovery carried an ironic historical note: early comments on the Firefox bug linked to a 2002 blog post where Willison had already complained about this exact behavior. He had forgotten both the Firefox feature and his own prior criticism, making the recent fix feel like rediscovering a longstanding frustration.

Read the full article

Continue reading at Simon Willison →

This is an AI-generated summary. Read the original for the full story.