本文介绍了如何测试Google AMP项目的CDN?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从这里引用: https://www.ampproject.org/docs/get_started/about-amp.html

  • AMP HTML
  • AMP JS
  • AMP CDN
  • AMP HTML
  • AMP JS
  • AMP CDN

AMP HTML是对可靠性能和性能有一些限制的HTML 一些扩展功能,可用于构建超出基本HTML的丰富内容. AMP JS库可确保快速呈现AMP HTML页面. AMP CDN (可选)提供AMP HTML页面.

AMP HTML is HTML with some restrictions for reliable performance and some extensions for building rich content beyond basic HTML. The AMP JS library ensures the fast rendering of AMP HTML pages. The AMP CDN (optionally) delivers the AMP HTML pages.

从这里引用: https://www.ampproject.org/how-it-作品/

在哪里可以找到此CDN服务,因此可以对其进行测试?我在Google上搜索了很多,但找不到任何信息.

Where can I find this CDN service, so I can test it? I googled a lot, but I couldn't find any information.

推荐答案

要使用AMP项目CDN,可以通过以下格式的URL访问:

To use the AMP project CDN, you can access via a URL of the form:

https://cdn.ampproject.org/c/s/<origin-domain>/<path>

请注意,/s部分是可选的,表示安全来源,因此,如果未通过https提供该来源,则可以使用:

Note that the /s portion is optional and signals a secure origin, so if the origin isn't served over https, then you would use:

https://cdn.ampproject.org/c/<origin-domain>/<path>

因此,如果我们采用与AMP等效的以下网址: http://www.theguardian.com/childrens-books-site/2016/jan/12/sugar-tax-andy-mulligan-liquidator ,查看源代码,我们看到以下链接:

So, if we take the following URL that has an AMP equivalent: http://www.theguardian.com/childrens-books-site/2016/jan/12/sugar-tax-andy-mulligan-liquidator, looking at the source, we see the following link:

<link rel="amphtml" href="https://amp.theguardian.com/childrens-books-site/2016/jan/12/sugar-tax-andy-mulligan-liquidator">

因此,我们可以为AMP文档形成CDN URL,如下所示:

So, we can form a CDN URL for that AMP document as:

https://cdn.ampproject.org/c/s/amp.theguardian.com/childrens-books-site/2016/jan/12/sugar-tax-andy-mulligan-liquidator

来源: https://github. com/ampproject/amphtml/blob/master/src/service/cid-impl.js#L201

这篇关于如何测试Google AMP项目的CDN?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 16:18