JS Wei (Jack) Sun

Datasette strips rel=next to dodge Firefox's 24-year prefetch bug

Datasette now strips rel=next headers for Firefox because a 24-year-old prefetch bug turns pagination hints into background SQL load.

Datasette strips rel=next to dodge Firefox’s 24-year prefetch bug

TL;DR

  • Datasette removes Link: rel="next" headers when serving HTML to Firefox clients.
  • Firefox silently prefetches every rel=next URL, firing expensive SQL queries unprompted.
  • Bugzilla report on the prefetch default has sat open for 24 years with no fix.
  • Google retired rel=prev/next as an indexing signal years ago, removing the upside of emitting it.

Today’s single AI tech item is a small, telling piece of web-infrastructure maintenance. Datasette now strips Link: rel="next" headers when Firefox requests an HTML page, because Firefox will quietly prefetch that URL in the background — and for a Datasette instance, the “next page” is an expensive SQL query against a user-facing table. The bug sits in Firefox. It has sat there for 24 years. It is not moving.

The frame worth noting: the original reason to emit rel=prev/next — Google treating it as a pagination signal for indexing — was retired by Google years ago. So the standard has no remaining upside for Datasette, one browser weaponizes it against the server, and the only actor left willing to fix anything is the app. That is the shape of a lot of small web-plumbing decisions in 2026: upstream won’t move, so downstream ships the workaround.

Datasette strips rel=next headers to stop Firefox prefetches

Source: simon-willison · published 2026-11-07

TL;DR

  • Datasette now strips Link: rel="next" HTTP headers when Firefox requests HTML pages.
  • Firefox was silently prefetching every “next page” of expensive SQL-rendered tables in the background.
  • The Firefox prefetch behavior has sat in Bugzilla for 24 years with no default change.
  • Google dropped rel=prev/next as an indexing signal years ago, gutting the main reason to emit it.

A one-line patch on top of a three-way standards failure

Willison noticed the problem the way most of these get noticed: the Firefox network panel lit up with a request he didn’t make. Every Datasette table page was serving a Link: <...?_next=...>; rel="next" header, and Firefox was obediently fetching the next page in the background — running the full SQL query, rendering the full HTML, and throwing the result away for the ~99% of visitors who never click through.

The fix in issue #3046 is small: sniff the User-Agent, and if it’s Firefox requesting HTML, skip the header. In-body “Next” links stay. It works. It’s also exactly the anti-pattern modern web guidance tells you to avoid — which is the interesting part.

One bit of digital archeology made the fix: the Bugzilla thread tracking this behavior has been open for 24 years, and one of the early comments links to Willison’s own 2002 blog post complaining about the exact same feature. He’d forgotten he ever wrote it.

Why the “invisible optimization” isn’t invisible

Prefetching is marketed as free performance. In practice, independent measurement disagrees. DebugBear found that low-priority prefetches routinely contend with high-priority assets like LCP images, so speculative fetches can measurably slow down the current page 1. On the Chrome side, Malwarebytes has documented cases where its Browser Guard flagged speculative background requests as suspicious, surfacing confusing block pages to users who hadn’t clicked anything 2.

For a Datasette instance backed by a modest VPS, the cost is more direct: every table view roughly doubles in backend work, with no corresponding user benefit.

The SEO justification already collapsed

The original reason to emit rel="next" at the HTTP layer was search indexing. That rationale is largely gone. Google confirmed in 2019 that it had stopped using rel=prev/next as an indexing signal years earlier, without telling anyone 3. Bing still consumes the hint as a structural signal, and some accessibility tooling uses it 4, so the markup isn’t worthless — but it’s nowhere near valuable enough to justify the prefetch tax.

The fix that should exist

The clean answer is Sec-Purpose: prefetch — a Sec-prefixed, browser-controlled header that servers can key off to short-circuit speculative traffic without UA sniffing or spoofing risk 5. Mozilla has been actively aligning other prefetch paths with this standard 6, and Chromium already emits it. The gap is that Firefox’s rel="next"-triggered prefetches don’t yet carry it reliably enough for a server to detect.

flowchart LR
    S[Datasette response] -->|Link: rel=next| F[Firefox]
    F -->|background GET<br/>no Sec-Purpose| S2[Datasette renders<br/>full next page]
    S2 -.->|discarded| X[/dev/null]
    F -.->|should send| SP[Sec-Purpose: prefetch]
    SP -.->|server could skip| S2

Takeaway

Read narrowly, this is a niche patch to one Python project. Read widely, it’s a worked example of a three-way failure: a browser heuristic nobody will fix by default, a semantic hint whose primary consumer walked away, and a replacement standard that isn’t wired through the path that matters. The UA sniff is pragmatic. The real fix belongs upstream in Firefox, not in every data-heavy app that happens to paginate.

Footnotes

  1. DebugBear — ‘How prefetch can make your website slower’ — https://www.debugbear.com/blog/prefetch-slower-website

    Prefetch requests, despite being assigned low priority, often compete with high-priority assets like Largest Contentful Paint (LCP) images, paradoxically slowing down the current page load.

    ↩
  2. Malwarebytes Labs — https://www.malwarebytes.com/blog/product/2026/02/chrome-preloading-could-be-leaking-your-data-and-causing-problems-in-browser-guard

    Security software like Malwarebytes Browser Guard… documented cases of blocking ‘mysterious’ background requests triggered by Chrome’s prefetcher, leading to confusing block pages for users.

    ↩
  3. Search Engine Journal — https://www.searchenginejournal.com/google-stopped-supporting-relprev-next-in-search-indexing-years-ago/299689/

    Google stopped supporting rel=prev/next in search indexing years ago

    ↩
  4. Meshline.io — pagination SEO guidance — https://meshline.io/blog/rel-next-prev-pagination-seo-keep-or-remove

    Despite Google’s stance, many experts recommend keeping existing rel=next/prev markup… Bing still utilizes these tags as hints for discovery and site structure.

    ↩
  5. http.dev — Sec-Purpose reference — https://http.dev/purpose

    The Sec-Purpose header signals whether a request is for immediate use or a prefetch/prerender operation… the Sec- prefix identifies it as a forbidden request header, meaning it is controlled strictly by the browser and cannot be modified or spoofed by client-side JavaScript.

    ↩
  6. Mozilla Bugzilla #1304912 — https://bugzilla.mozilla.org/show_bug.cgi?id=1304912

    Recent efforts in related bugs have focused on aligning with the Sec-Purpose: prefetch standard, which helps prevent issues like double-prefetching and improves compatibility with CORS specifications.

    ↩
Jack Sun

Jack Sun, writing.

Engineer · Bay Area

Hands-on with agentic AI all day — building frameworks, reading what industry ships, occasionally writing them down.

Digest
All · AI Tech · AI Research · AI News
Writing
Essays
Elsewhere
Subscribe
All · AI Tech · AI Research · AI News · Essays

© 2026 Wei (Jack) Sun · jacksunwei.me Built on Astro · hosted on Cloudflare