有没有办法使用备用CDN来包含AMP需要的主要
JavaScript文件?可以使用与https://cdn.ampproject.org/v0.js不同的URL吗?是否有计划通过允许其他在中国没有封锁的CDN等来打开这一点?
使用网络搜索返回的几个顶级代理,似乎在中国阻止了ampproject.org.这并不令人惊讶,因为其他Google资源被屏蔽了.
解决方法
不幸的是,我认为AMP所需的主要Javascript的源文件只能通过https://cdn.ampproject.org URL访问.
根据博客“Getting started with AMP Html,accelerated mobile pages”
AMP does this by creating new rules for bottlenecks: JavaScript and html elements that are considered slow are prohibited. JavaScript is only allowed using libraries provided by the CDN of Google itself.
也在他们的官方网页上:
Our goal with AMP HTML is reliable performance,so we designed it to be easily cacheable by content delivery networks (CDNs). Google is offering a service that delivers AMP HTML documents given their URL through its CDN. Others can use this service or make their own or serve AMP HTML pages from a plain-old-web-server.