gpt4 book ai didi

google-cdn - 如何测试 Google AMP 项目的 CDN?

转载 作者:行者123 更新时间:2023-12-04 09:05:05 26 4
gpt4 key购买 nike

引自此处:https://www.ampproject.org/docs/get_started/about-amp.html

AMP is a way to build web pages for static content that render fast. AMP in action consists of three different parts:

  • AMP HTML
  • AMP JS
  • AMP CDN

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-works/

Google is offering a service that delivers AMP HTML documents given their URL through its CDN.



我在哪里可以找到这个 CDN 服务,以便我可以测试它?我用谷歌搜索了很多,但找不到任何信息。

最佳答案

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

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

请注意 /s部分是可选的并表示安全来源,因此如果来源不是通过 https 提供的,那么您将使用:
https://cdn.ampproject.org/c/<origin-domain>/<path>

因此,如果我们采用以下具有 AMP 等效项的 URL: http://www.theguardian.com/childrens-books-site/2016/jan/12/sugar-tax-andy-mulligan-liquidator ,查看源码,我们看到如下链接:
<link rel="amphtml" href="https://amp.theguardian.com/childrens-books-site/2016/jan/12/sugar-tax-andy-mulligan-liquidator">

因此,我们可以为该 AMP 文档形成一个 CDN URL:
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-cdn - 如何测试 Google AMP 项目的 CDN?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34720444/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com