互联网与文化hookrace.net
Time.gif:一张动图里的时间之旅
Time.gif
2017 — 2022,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这篇文章介绍作者如何做出一个 time.gif:服务器不是返回一张静态 GIF,而是持续向浏览器推送新生成的 GIF 帧,让页面里的图片看起来像实时时钟或动画。它把 multipart/x-mixed-replace 这类老式 HTTP 推送技巧用在 GIF 上,并讨论了实现细节与浏览器兼容性。
为什么经久不衰:它用极简的老 Web 技巧实现实时 GIF,既有趣又有历史纵深感,今天读来仍能启发对 HTTP 流式传输和浏览器行为的理解。
HN 评论精选
早期用 CGI 无限推送帧实现动画,因不节流拖垮了服务器。
1994 年我读高中时还没有动态 GIF。当时让浏览器里的图片动起来的一种办法,就是类似这样的机制。我写过一个 C 程序,加载 6 帧笑脸动画,然后对任何请求这张图片的人无限循环地依次送出这些帧,Mosaic 会乐意把它们动起来。后来我被叫到网站管理员办公室:Web 服务器宕了。那是台捐赠的 Silicon Graphics Origin 服务器,按我的记忆是相当强的机器。这个 cgi-bin C 程序会尽可能快地加载 6 张图并塞进网络套接字,不节流,也不检查客户端是否断开。它只有一项任务,并且高效无情地完成了它。可怜的服务器。
koliber查看英文原文
In 1994 I was in high school, and there were no animated GIFs. One way you could make images move in the web browser was to use a mechanism similar to this. I wrote a C program which would load 6 frames of a smiley face animation and would feed them sequentially, in an endless loop, to anyone who requested the image. Mosaic was happy to animate them. I get called in to the web mistress's office. The web server is down. We had a donated Silicon Graphics Origin server, if my memory serves me correctly. This was a beefy machine. The cgi-bin C program would load 6 images, as fast as it possibly could, and dump them into a network socket. It would not throttle. It would not check if the client disconnected. It had one job. It did it efficiently, and ruthlessly. Poor server.
同样用 multipart/x-mixed-replace 做过 GIF 时钟。
很久以前我也用 multipart/x-mixed-replace 内容类型做过类似的事:http://zabasoft.xf.cz/clock.gif
janci查看英文原文
I did something similar long time ago with multipart/x-mixed-replace content type. http://zabasoft.xf.cz/clock.gif
mJPEG 流是更可靠的替代方案。
大约十五年前,我也用 PHP 脚本生成 mJPEG 流做过同样的事。就我记忆所及,它似乎比用 GIF 更可靠。见 Motion JPEG 的维基页面。
oxymoron查看英文原文
I did the same thing about fifteen years ago by generating a mJPEG stream from a PHP-script. As far as I can remember, it seemed more reliable than using GIF. See https://en.wikipedia.org/wiki/Motion_JPEG
美国海军天文台曾提供精确 GIF 时钟,该服务现已迁移或停用。
多年来,美国海军天文台会生成一个精确的主时钟 .gif。可惜这项服务似乎已经停止,除非有人能找到这个 .gif 生成器的新地址。失效链接是:http://tycho.usno.navy.mil/cgi-bin/nph-usnoclock.gif?zone=est&ticks=04 。Tycho 关于 gif 时钟的最后留言在:https://web.archive.org/web/20191015032841/http://tycho.usno.navy.mil/ 。精确时间部门现在在这里:https://www.cnmoc.usff.navy.mil/Our-Commands/United-States-Naval-Observatory/Precise-Time-Department/ 。他们现在把时间显示指向 https://www.time.gov 。
rpaddock查看英文原文
For years the US Naval Observatory would generate a precise .gif of the master time clock. Alas it seems the service has been discontinued, unless someone here can find the new home for the .gif generator. This is the dead link: http://tycho.usno.navy.mil/cgi-bin/nph-usnoclock.gif?zone=est&ticks=04 The last message from Tycho about the gif clocks: https://web.archive.org/web/20191015032841/http://tycho.usno.navy.mil/ The Precise Time Department is here now: https://www.cnmoc.usff.navy.mil/Our-Commands/United-States-Naval-Observatory/Precise-Time-Department/ They now refer Time Displays to https://www.time.gov
历次讨论
同类还值得读
如今电脑上几乎所有操作在感知上都比 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编辑精选