跳到正文
Simon Willison·· 15 天前精选AI 评分33

Datasette #3046:不再向 Firefox HTML 页面发送 rel=next HTTP 头

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

AI 导读

Datasette #3046 调整了 HTML 页面对 Firefox 的 rel=next HTTP 头处理,以避免浏览器预取表格的下一页。此前,Firefox 会因该 HTTP link 头提前请求下一页数据,导致服务器渲染可能无人访问的页面。

正文 · 原文

7th November 2026 - Link Blog

datasette #3046: Don't serve link: rel=next HTTP headers to Firefox for HTML pages. I was looking at the Firefox network panel today when I noticed that requests to a Datasette table page were triggering an HTTP prefetch to the next page of rows in that table.

This was happening because Datasette pages serve an HTTP link header like this:

link: <https://latest.datasette.io/fixtures/compound_three_primary_keys?_next=a%2Cd%2Cv>; rel="next"

This is bad. A tiny fraction of the visitors to one of those pages will click the "next" link, which means their browser is fetching unnecessary data and the Datasette server is having to render an entire page that then gets thrown away.

I dug in and learned that Firefox has an issue that has been open for 24 years about this behavior...

And one of the early comments on that issue links to my blog post from 2002 complaining about this feature. I hadn't just forgotten that I had written about it, I had forgotten the feature entirely!

来源:Simon Willison · simonwillison.net