微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

amp-html – 是否可以在AMP中使用备用CDN,因为ampproject.org在中国被屏蔽?

有没有办法使用备用CDN来包含AMP需要的主要 JavaScript文件?可以使用与https://cdn.ampproject.org/v0.js不同的URL吗?是否有计划通过允许其他在中国没有封锁的CDN等来打开这一点?

使用网络搜索返回的几个顶级代理,似乎在中国阻止了ampproject.org.这并不令人惊讶,因为其他Google资源被屏蔽了.

编辑:我应该提到我尝试复制文件并在本地运行它,但AMP验证器在我尝试时抛出错误.

解决方法

不幸的是,我认为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.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐