關於 twemoji.maxcdn.com 這個網址的一些事情

在「phpBB 3.3.10 Release」這邊看到這個修正,研究了一下發現原來有些故事在後面跑:

Update the emoji CDN: PHPBB3-17071

Twitter Emoji (Twemoji) 這個計畫是 Twitter 弄出來的 open source project,最主要是讓不支援新版 Unicode 的系統上可以改用圖片顯示出來 (畢竟 Unicode 一直在加字)。

其中提供的 url 是 https://twemoji.maxcdn.com/v/latest/twemoji.min.js,可以看到裡面帶有 MaxCDN 的資訊,算是一種廣告,但後來 StackPath 在 2016 併購 MaxCDN,接下來是在去年打算要淘汰掉 MaxCDN 這個產品線:「MaxCDN and SecureCDN are Retiring; Here’s What It Means for You」。

這件事情被帶到「Clarify MaxCDN URLs now that MaxCDN is retiring #556」這邊討論,但看起來沒有太多動作,後來在「Maxcdn has shut down, cdn not working anymore. #580」這邊又被帶起來討論,其中 Twitter 前員工大概提了一下情況,主要是當年他們跟 MaxCDN 有談過讓 MaxCDN 負責頻寬的部份:

@simplexx among all the things, twemoji has always been a Twitter service for the community.

At my times in there, we had a great agreement / deal with MaxCDN so that it's hard to blame the boss this time, as MaxCDN is a completely different company/story.

What I see is some poor attention to this project, as companies don't close from a day to another (usually?) but as we all know what's going on @ twitter, I can't really blame any of my former colleagues, or new arrivals there.

Please let's not make it a wall of shame for all the people that worked on this, thanks for your understanding (I've left 7 years ago or more, as example, I've got pinged by some follower and I'm just trying to help you out anyway).

另外也有人提到目前 Twitter 的溝通管道的狀況:

For what it's worth, while I was still there we were in talks with MaxCDN to have the same deal when they migrated to be Stackpath. Everyone who had worked on the deal with MaxCDN had left and left no record of that deal, so it was taking them a bit longer to work out than expected – MaxCDN used to offer free hosting to OSS projects, but Stackpath wouldn't be doing that. They were working on an exception for us, but any emails they send to our Twitter emails now get bounced, so I guess they could've gotten this sorted out before shutting down MaxCDN... but it's not like we're there on the other end to make it happen, so it appears we'll never know.

Anyway,現在是至少讓 twemoji.maxcdn.com 恢復到「會動」了,但情況變得很特殊,twemoji.maxcdn.com 這個網址目前是指到競業的 BunnyCDN 上:

;; ANSWER SECTION:
twemoji.maxcdn.com.     229     IN      CNAME   twemoji.b-cdn.net.
twemoji.b-cdn.net.      35      IN      A       23.248.177.58

但如果你真的打過去要檔案,會是 301 到 jsDelivr 上:

$ http https://twemoji.maxcdn.com/2/svg/1f525.svg
[...]
Location: https://cdn.jsdelivr.net/npm/twemoji@11.3.0/2/svg/1f525.svg
[...]

而 jsDelivr 目前是放在 Fastly 上:

;; ANSWER SECTION:
cdn.jsdelivr.net.       180     IN      CNAME   jsdelivr.map.fastly.net.
jsdelivr.map.fastly.net. 30     IN      A       199.232.45.229

但在 GitHub 的說明上面則是建議用 UNPKG

<script src="https://unpkg.com/twemoji@latest/dist/twemoji.min.js" crossorigin="anonymous"></script>

而 UNPKG 目前的 CDN 的部份則是 Cloudflare

;; ANSWER SECTION:
unpkg.com.              86400   IN      NS      anirban.ns.cloudflare.com.
unpkg.com.              86400   IN      NS      aron.ns.cloudflare.com.
;; ANSWER SECTION:
unpkg.com.              300     IN      A       104.16.126.175
unpkg.com.              300     IN      A       104.16.123.175
unpkg.com.              300     IN      A       104.16.122.175
unpkg.com.              300     IN      A       104.16.124.175
unpkg.com.              300     IN      A       104.16.125.175

指到 BunnyCDN 但是 BunnyCDN 只負責 redirect,然後也不是導到 UNPKG 上...

Bootstrap 的 CDN 從 MaxCDN 換到 StackPath (Highwinds) 了...

最近在寫網頁時發現 Bootstrap 的網站上給的 CDN 網址改了,從本來用的 maxcdn.bootstrapcdn.com (MaxCDN) 變成 stackpath.bootstrapcdn.com (StackPath,本來的 Highwinds)。

而且看起來跟 MaxCDN 的合作已經全部停了,現在 maxcdn.bootstrapcdn.com 也是指到 StackPath 上。

翻了 Wayback Machine 上的記錄,看起來是在 2018040904501720180410051321 這之間換的,也就是大約是在 2018/04/10 前後換的。不知道後面的交易是什麼...

可以參考 K 社的 SmokePing 資料「SmokePing Latency Page for netdna.bootstrapcdn.com (NetDNA, Bootstrap)」:

可以看到 HiNet 走的點的latency 比之前好不少...

MaxCDN 將中止 TLS 1.0 的支援

這一槍開的好早,MaxCDN 宣佈因為安全性問題,決定從下個禮拜就中止對 TLS 1.0 的支援:「We're Disabling TLS 1.0 Support on March 18, 2016」。

而且新聞稿也寫的超怪:

After sunsetting TLS 1.0 at MaxCDN, we will continue to support TLS 1.1 and TLS 1.2, though we highly recommend TLS 2.0 for your toolset. It’s currently the fastest and most secure cryptographic protocol available, though TLS 3.0 is in the works.

其中提到了 TLS 2.0,害我去查了查發生什麼事情。而 TLS 3.0 的連結實際上是連到 TLS 1.3 draft。而實際確認數字會發現,有不少行動裝置還是只支援 TLS 1.0,用 MaxCDN 的人就準備掛光:

  • Android 4.3 以及之前的版本,大約佔整個 Android 的 27%,出自「Dashboards」的數據。
  • Java 7 以及之前的版本。
  • Windows 7 上的 IE10 以及之前的版本。

這家 CDN 果然怪怪的... 在 TLS 1.0 仔細設定可以保持安全性的情況下,加上還有這麼多 client 要支援,做生意的突然來被這招陰是要怎麼玩 :o

用 RawGit 服務供應檔案

RawGit 可以讓你直接連 GitHub 的檔案,並且帶入適當的 Content-Type

RawGit serves raw files directly from GitHub with proper Content-Type headers.

production url 用的是 NetDNA (MaxCDN):

cdn.rawgit.com.         3600    IN      CNAME   rawgit.rawgh.netdna-cdn.com.

不過一般情況下可以直接用 raw.github.com,這個是 GitHub 提供的網址,目前使用 Fastly

raw.github.com.         30      IN      CNAME   github.map.fastly.net.

免費的 CDN 資源

在「A List of Free Public CDNs for Web Developers」這篇文章裡面列出了網路上免費的 CDN 資源。

可以看到 MaxCDN (jsDelivrOSSCDNjQuery CDN) 與 CloudFlare (cdnjs) 都投資了不少在其中。不過 MaxCDN 的部份都沒有拿出亞洲 PoP 來用,速度還是慢了不少...

對於有使用各種套件的人,可以在這邊的列表上找一找,除了可以節省自己機器的頻寬負擔外,另外用 CDN 也有機會與其他人共用 cache 而加速...