跳到正文
Simon Willison·· 26 天前

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

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

中文摘要

datasette #3046:不要向Firefox发送HTML页面的rel=next链接HTTP头部 今天我在查看Firefox的网络面板时,注意到对Datasette表格页面的请求会触发对该表格下一页行的HTTP预取。这是因为Datasette页面会发送类似这样的HTTP链接头部:link: <https://latest.datasette.io/fixtures/compound_three_primary_keys?_next=a%2Cd%2Cv>; rel="next" 这是不好的。在这些页面中,只有一小部分访问者会点击“下一页”链接,这意味着其他人浏览器正在获取不必要的数据,而Datasette服务器则必须渲染整个页面,然后将其丢弃。 我深入研究后了解到,Firefox存在一个已经开放了24年的关于此行为的问题……该问题早期的评论之一链接到了我2002年的一篇博客文章,当时我抱怨这个功能。我不仅忘记了自己曾经写过关于这个功能的文章,甚至已经完全忘记了这个功能! 标签:firefox , html , mozilla , datasette

英文原文

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 for everyone else 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! Tags: firefox , html , mozilla , datasette

应来源方要求,这里只提供摘要与原文入口。完整内容请阅读原文。

来源:Simon Willison · simonwillison.net