Hacker News new | ask | show | jobs
by kuschku 3228 days ago
There is no direct source, but you can try it, or just look at the current implementation.

Currently, Google serves AMP by serving all AMP search results from its own cache, which allows Google to add features such as the header bar, or the swiping between carousel elements. This doesn’t work if the pages are from different origins.

EDIT: I found some sources:

> contain a <script async src="https://cdn.ampproject.org/v0.js"></script> tag inside their head tag.

https://www.ampproject.org/docs/reference/spec#required-mark...

Which prevents self-hosting the JS

And https://developers.google.com/amp/cache/faq

> Q: Can I stop content from being cached?

> A: No. By using the AMP format, content producers are making the content in AMP files available to be cached by third parties. For example, Google products use the Google AMP Cache to serve AMP content as fast as possible.

1 comments

> Q: Can I stop content from being cached?

How different is this from common HTML caching done all over the web? And that's about using the Google AMP Cache, not about using AMP.

And you still didn't provide a source about "having to use Google's CDN".

Essentially: do AMP pages hosted on Cloudflare's cache do not get into Google Search carrousel?

The answer to your question is no: google's search results only ever link to google's cache for your page.

Link here:

https://blog.branch.io/google-accelerated-mobile-pages-amp-a...

> Anyone can use a CDN to set up and run an AMP cache, but only content in Google’s cache (which Google has stated can be used without restriction and at no cost) is currently getting preferred search results treatment

But the whole point is kinda moot because AMP requires that your assets be "cacheable", which means google will come along and cache them, and the search results will use the google-cached version.

So sure, another CDN could cache your stuff, but nobody clicking through a google search result will ever hit it.

> How different is this from common HTML caching done all over the web? And that's about using the Google AMP Cache, not about using AMP.

> And you still didn't provide a source about "having to use Google's CDN".

This is the issue I meant with Google’s CDN/Cache.

If a user clicks a link to an AMP page in Google search, they are not redirected to your page. They ALWAYS get the cached version from Google, and Google modifies your page by adding UI, and changing other functionality (for example, the left/right swipe gestures are changed to navigate to other Google search results).

You can not opt out of this while still appearing in the carousel.