互联网与文化danluu.com编辑精选
网速慢时,网页体验有多糟
The web sucks if you have a slow connection
2017 — 2021,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
Dan Luu 的这篇文章讨论“网页臃肿”(web bloat):现代网页的体积、请求数量和广告脚本已经膨胀到在慢速或计费网络下几乎无法使用的程度。文中给出了在不同网络条件下访问常见网站时的加载测量数据,并指出开发者通常用自己的快速连接来假设用户的网络环境。
为什么经久不衰:十多年过去,网页只会越来越重,而这篇用扎实数据和清晰论证说明“开发者的网速不等于用户的网速”,至今仍是讨论性能与可访问性时最常被引用的文章。
HN 评论精选
性能指标变差可能是用户群扩大的好迹象,平均值会掩盖这类进步。
我在谷歌工作时,有人给我讲过一个故事:"他们"完成了一轮大规模优化,结果发现测得的页面加载时间反而变长了。深入看数据后发现,原因是优化之后来自非洲的流量大增——产品从对慢速连接用户不可用变成了可用,于是大量慢速连接用户涌入,反而把平均加载时间拉高了。
ikeboy查看英文原文
>When I was at Google, someone told me a story about a time that “they” completed a big optimization push only to find that measured page load times increased. When they dug into the data, they found that the reason load times had increased was that they got a lot more traffic from Africa after doing the optimizations. The team’s product went from being unusable for people with slow connections to usable, which caused so many users with slow connections to start using the product that load times actually increased.
真正的问题是缺少一种标准机制,让重资源成为可选项而非必选项。
我一直在想一个问题:2017 年了,正确的做法是什么——如何提供那些能改善快网/不限流量用户体验的可选资源,又能让慢速/限流量连接上的用户代理安全地忽略它们?比如高清主图、视频背景。每次 HN 上有人问类似问题,总有人说"资源不是必需的,一开始就别发",但这一是不现实,二是忽略了典型 HN 用户喜欢的极简文字页面在其他人群里根本不成立,而且牺牲快网用户体验来迁就慢速用户往往也不可接受。所以:如果我想放一个大资源,又想告诉慢速连接的 UA 它们不必下载,该怎么做?
gabemart查看英文原文
Something I have had at the back of my mind for a long time: in 2017, what's the correct way to present optional resources that will improve the experience of users on fast/uncapped connections, but that user agents on slow/capped connections can safely ignore? Like hi-res hero images, or video backgrounds, etc. Every time a similar question is posed on HN, someone says "If the assets aren't needed, don't serve them in the first place", but this is i) unrealistic, and ii) ignores the fact that while the typical HN user may like sparsely designed, text-orientated pages with few images, this is not at all true of users in different demographics. And in those demos, it's often not acceptable to degrade the experience of users on fast connections to accommodate users on slow connections. So -- if I write a web page, and I want to include a large asset, but I want to indicate to user agents on slow/capped connections that they don't _need_ to download it, what approach should I take?
亲身经历:在 2G 速度下现代网站基本加载不出来,还常被误判为使用广告拦截。
我是吃了苦头才知道的。T-Mobile 曾在 Simple Choice 套餐里于 100 多个国家提供 2G 国际漫游,限速 50 kbit/s,比 56K 调制解调器还慢。对后台进程(比如通知)甚至查邮件都够用,但大多数网站根本加载不出来:资源超时,光广告就好几兆。甚至有几个网站因为我"用了广告拦截"而封我,其实只是广告没能及时加载。这让我同情那些还在用 2G 的印度农村等地的人——它适合某些用途,但已经无法用于一般网页浏览了。(补充:T-Mobile 现在国际漫游是 3G,当时只是免费附赠的。)
Someone1234查看英文原文
I found out this the hard way. T-Mobile used to offer 2G internet speeds internationally in 100+ countries included in Simple Choice subscriptions. 2G is limited to 50 kbit/s, that's slower than a 56K modem. While this absolutely fine for background processes (e.g. notifications) and even checking your email, most websites never loaded at these speeds. Resources would time out, and the adverts alone could easily exceed a few megabytes. I even had a few website block me because of my "ad blocker" because the adverts didn't load timely enough. Makes me feel for people in like rural India or other places still only at 2G or similar speeds. It is great for some things, not really useable for general purpose web browsing any longer. PS - T-Mobile now offers 3G speeds internationally; this was just the freebie at the time.
网络条件对同一个人也会随时变化,延迟和小请求数量的代价被严重低估。
这些性能数字很好地说明了大量网站的问题。它漏掉的一点(我看到大家也常忘记)是:同一个用户一天中可能在多个时刻处于那种糟糕连接,甚至在不同网络间移动。你家宽带再快也没用,如果你正在商店里想用手机查点东西,而页面臃肿不堪;商店用 SPA 做花哨的切换渐隐效果也没什么安慰——它在商店实体店里自己都加载不出来。太多 web 开发者对带宽乃至延迟都做了糟糕假设:一百个小连接总流量可能不大,但如果每个连接光是建立就要 0.1–0.25 秒,用户就有大量时间被卡着什么都做不了。异步加载只是"我不显式阻塞这次加载",不代表几十个在途请求不会造成事实上的阻塞。我用 web 不是为了欣赏巨大的主图和渐隐效果,我是为了完成某件事;让我用时间、带宽和电量去迁就臃肿页面,只会让我不想给你钱。
giantrobot查看英文原文
The performance numbers are a really helpful illustration of the problem with a lot of sites. A detail it misses and I see people constantly forget, is any individual user might have one of those crappy connections at multiple points during the day or even move through all of them. It doesn't matter if your home broadband is awesome if you're currently at the store trying to look something up on a bloated page. It's little consolation that the store wrote an SPA to do fancy looking fades when navigating between links when it won't even load right in the store's brick and mortar location. Far too many web devs are making terrible assumptions about not just bandwidth but latency. Making a hundred small connections might not require a lot of total bandwidth but when each connection takes a tenth to a quarter of a second just to get established there's a lot of time a user is blocked unable to do anything. Asynchronous loading just means "I won't explicitly block for this load", it doesn't mean that dozens of in-flight requests won't cause de facto blocking. I'm using the web not because I love huge hero images or fade effects. I'm using the web to get something accomplished like buy something or look up information. Using my time, bandwidth, and battery poorly by forcing me to accommodate your bloated web page makes me not want to give you any money.
历次讨论
同类还值得读
如今电脑上几乎所有操作在感知上都比 1983 年更慢(2017)
Almost everything on computers is perceptually slower than it was in 1983 (2017)
2017 年的推文串认为,尽管计算机硬件比 1983 年快得多,日常操作的感知速度却常常更慢:启动、界面响应和网络应用被层层抽象、动画、后台检查与网络依赖拖累。
互联网与文化上首页 5 次 · 2017–2020twitter.com网站肥胖危机
The Website Obesity Crisis
Maciej Cegłowski(idlewords)的经典演讲文稿《网站肥胖症危机》,批评现代网页越来越臃肿:动辄数 MB 的 JavaScript、追踪脚本和广告,把本可以轻…
互联网与文化上首页 5 次 · 2016–2021idlewords.com编辑精选亚马逊那本标价 23,698,655.93 美元的苍蝇书
Amazon’s $23,698,655.93 book about flies
博文讲的是亚马逊上一本关于果蝇的二手书被标到 23,698,655.93 美元。
互联网与文化上首页 5 次 · 2011–2022michaeleisen.org浏览器 User-Agent 字符串的历史
History of the browser user-agent string (2008)
2008 年的经典文章用戏谑的“创世纪”口吻,讲述浏览器 User-Agent 字符串如何从简单的标识演变成层层叠加的伪装:浏览器为了绕过按 UA 分发的网站检测,纷纷把自己伪装…
互联网与文化上首页 5 次 · 2012–2022webaim.org编辑精选最后的问题——艾萨克·阿西莫夫
The Last Question - Isaac Asimov
阿西莫夫最著名的短篇科幻小说《最后的问题》的在线全文。
互联网与文化上首页 5 次 · 2009–2019multivax.com编辑精选