Conversation
GitHub proxies external images through Camo, which fetched the demo GIF while the CDN was mid-refresh and cached the truncated result: 1801375 of 4149835 bytes, 66 of 133 frames, and a broken LZW stream, so the animation stopped partway through. Camo keys its cache on an HMAC of the source URL and holds it for a year, so replacing the file in place could never dislodge it. Point both READMEs at demo1-v2.gif, which gives Camo a new URL to fetch. The file is also re-encoded at 900x506 and 8fps to keep terminal text legible while staying well under Camo's 5 MiB proxy limit, which the original 7.5 MB upload had exceeded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
README 里的 StepPage 演示 GIF 在 GitHub 上只播一半就断了。逐层排查后定位到 GitHub 的图片代理 Camo:
Camo 在 CDN 刷新过程中抓取,拿到一个传输中断的残缺文件并缓存了下来(
x-cache: HIT,max-age=31536000)。它的缓存键是源地址的 HMAC,所以原地覆盖同名文件永远无法让它回源 —— 这也是先前多次刷新 CDN 都无效的原因。首次上传的 7.5 MB 文件还另外触发了一个问题:超过 Camo 的 5 MiB 代理上限,直接返回 404。
修复
两个 README 的图片地址改为
demo1-v2.gif,给 Camo 一个全新的 URL 去抓取。新文件同时重新编码为 900x506 / 8fps,在保证终端文字可读的前提下留出充足的体积余量。验证
改 README 之前先确认源站返回完整文件,避免 Camo 再缓存一个坏副本:
content-length4352323,且无age头(回源新鲜响应)c7db1a9b0e415ccf6e0795de4798abc7与本地文件逐字节一致ffprobe读出 900x506 / 133 帧,无解码报错npm run check通过。边界
本次只改图片地址,不动文案与其他内容。旧的
demo1-small.gif仍留在 CDN 上,其对应的 Camo 缓存要到一年后才过期,不再被引用。