1

In this thread i discovered how to test the CDN of Google AMP.

But how can i use it in a production website?

I imagine that is possibile to set it in some way like Cloudflare or other similar services, isn't it?

Thanks.

Community
  • 1
  • 1
Killy
  • 300
  • 5
  • 13

1 Answers1

3

You're still going to be serving the AMP content from your own infrastructure, even if Google then collect it and make it available via theirs.

If you want to serve it yourself or from a CDN like Cloudflare then the Google CDN isn't involved - it doesn't seem to make much sense to chain one CDN to another or to rely on Google having your content in their cache for it to be available from another.

There's nothing in the AMP spec that governs how and from where the content is served. The AMP runtime doesn't control where assets come from.

So, using the BBC rather than the Guardian, for a given AMP document:

http://www.bbc.co.uk/news/amp/election-us-2016-35320021

The content comes from www.bbc.co.uk, which could point to their infrastructure or to a CDN like Cloudflare. Either way the AMP content is available.

I think your question is slightly unclear. Is this what you were looking for?

SteveW
  • 31
  • 2
  • Quoted from here: https://www.ampproject.org/docs/get_started/about-amp.html > The AMP CDN (optionally) delivers the AMP HTML pages. Quoted from here: [https://www.ampproject.org/how-it-works/][1] > Google is offering a service that delivers AMP HTML documents given > their URL through its CDN. How this CDN works? How can i implement it? Where can i find info about it? Thanks. [1]: https://www.ampproject.org/how-it-works/ – Killy Jan 18 '16 at 08:16
  • I think you got the answer in your other question @Killy. The Google CDN works by following the `link rel="amphtml"` tag in your documents. Google have done that for the above BBC article, so it is available via their AMP CDN on the URL https://cdn.ampproject.org/c/s/www.bbc.co.uk/news/amp/election-us-2016-35320021 So you implement it by having your HTML content point to your AMP content and having that content indexed by Google. I don't know of any documentation describing specifically how that CDN is implemented or how it works, though. – SteveW Jan 22 '16 at 18:33
  • I don't believe the AMP CDN is intended to replace your existing website. It's designed to be used when third parties link to AMP-enabled content. Don't expect your entire website to be served by the AMP CDN, especially by direct visitors. – Michael Mior Mar 15 '16 at 14:34