How can I check the CDN of the Google AMP project?

Quoted here: https://www.ampproject.org/docs/get_started/about-amp.html

AMP is a way to create web pages for static content that quickly renders. AMP in action consists of three different parts:

  • AMP HTML
  • AMP JS
  • AMP CDN

AMP HTML is HTML with some limitations for reliable performance and some extensions for creating rich content besides basic HTML. The AMP JS library provides quick rendering of AMP HTML pages. AMP CDN (optional) delivers AMP HTML pages.

Quoted here: https://www.ampproject.org/how-it-works/

Google offers a service that delivers AMP HTML documents with their URL via CDN.

Where can I find this CDN service so I can test it? I googled a lot, but could not find any information.

+7
google-cdn amp-html
source share
4 answers

To use the CDN of the AMP project, you can access it through the URL of the form:

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

Please note that the /s part is optional and signals a safe origin, so if the source is not transmitted over https, you should use:

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

So, if we take the following URL with the 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"> 

So, we can generate the CDN URL for this AMP document as:

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

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

+23
source share

CDN URL will change in 2017: https://developers.googleblog.com/2016/12/amp-cache-updates.html

Example above:

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

For a text example with http:

 http://example.com/blog/index.html 

Cache URL:

 https://example-com.cdn.ampproject.org/c/example.com/blog/index.html 

With https:

 https://example.com/blog/index.html 

Cache URL (note / s /):

 https://example-com.cdn.ampproject.org/c/s/example.com/blog/index.html 

For an image, replace / c / with / i /, e.g.

 http://example.com/blog/picture.jpeg 

Cache URL:

 https://example-com.cdn.ampproject.org/i/s/example.com/blog/picture.jpeg 

More information on creating cache URLs and name creation tools can be found here: https://developers.google.com/amp/cache/overview

0
source share

If you go to the Google AMP Cache page in the AMP developer documentation, a text box appears in which you can enter your original URL and the corresponding AMP cache URL is displayed.

enter image description here

0
source share

All Articles