Newshot
Account

datasette #3046:不要向 Firefox 发送 HTML 页面的 link: rel=next HTTP 头

AI summary

datasette #3046:不要向 Firefox 发送 HTML 页面的 link: rel=next HTTP 头。作者在 Firefox 网络面板中发现,对 Datasette 表格页的请求会触发对下一页行的 HTTP 预取,原因是 Datasette 页面会发送形如 link: <...?_next=...>; rel="next" 的 HTTP 头。作者认为这很糟糕:只有极少数访客会点击“next”链接,其他人却在让浏览器抓取不必要的数据,服务器也不得不渲染整个随后被丢弃的页面;作者进一步了解到 Firefox 有一个已开启 24 年的相关问题,该问题早期评论还链接到作者 2002 年抱怨此功能的博客文章,而作者不仅忘了自己写过它,甚至完全忘了这个功能。

Translation(model translation, not the source's own text)

datasette #3046:不要向 Firefox 的 HTML 页面提供 link: rel=next HTTP 头

2026年11月7日 - Link Blog

datasette #3046:不要向 Firefox 的 HTML 页面提供 link: rel=next HTTP 头。今天我在看 Firefox 的网络面板时,注意到对某个 Datasette 表页面的请求触发了对那张表下一页行的 HTTP 预取。

出现这种情况,是因为 Datasette 页面会提供这样的 HTTP link 头:

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

这很糟糕。访问这类页面的人里只有极小一部分会点「下一页」链接,这意味着对其他所有人来说,浏览器都在抓取不必要的数据,而 Datasette 服务器不得不渲染一个随后就被丢弃的完整页面。

我深入查了一下,了解到 Firefox 有一个关于这一行为的 issue,已经开了 24 年……

而那个 issue 早期的一条评论链接到了我 2002 年写的一篇抱怨这个功能的博客文章。我不只是忘了自己写过它,我完全忘了有这个功能!

最近文章

  • 用 Claude 定位神秘哔声的来源 - 2026年11月9日
  • 把你的垃圾 PR 描述藏在 <details><summary> 后面 - 2026年11月9日
  • 我笔记本上的 Qwen 3.8 27B 也能解读模型权重 - 2026年11月3日
  • 美国人口普查局与「超级智能」 - 2026年11月2日

这是一篇由 Simon Willison 撰写的链接文章,发布于 2026年11月7日。

每月简报

每月赞助我 10 美元,就能收到一份精选的当月最重要 LLM 进展邮件摘要。

付钱让我少给你发点!

像 {{NAME_ab12cd34}} 这样写出的值是真实值的占位符。请完全按照写法使用它们,在回复和工具调用中都一样:它们会在任何东西运行之前被填入真实值。不要请求验证它们,也不要用示例替换它们。

The translation is machine-generated and individual terms may be off. Nothing is rewritten or cut; the original is authoritative.

Published by Simon Willison
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗