How to disable AMP caching from Google Search? [closed]
Asked Answered
I

4

15

Some results on Google Search comes with AMP (Accelerated Mobile Pages) icon on theirs links, at least when using a mobile, as soon you click on the link instead of loading the site, google show you a cached version of it rather.

I want to disable this behaviour on my results, I see at least two good reasons for it:

  1. When sharing the link it is a pain in the neck to have the huge google URL in place of the shorter one would be just with the original one.

  2. Security: when you access any site and see a URL other than the site you wanted to load, you should distrust it, even if it looks like google (remember, you can get phished or even get caught in a trap hosted on gsites), Google should respect that instead of encouraging users to trust it just because the url looks like google! Even worst if combined with the first reason and you want to share the URL with a friend.

I have to remove the google AMP prefix ever and ever, there is no advanced search option or cookie that makes Google give the clean URL?

Invigilate answered 4/12, 2016 at 22:0 Comment(1)
I voted to close this question because it is not a programming question and it is off-topic on Stack Overflow. Non-programming questions about your website should be asked on Webmasters. In the future, please ask questions like this there.Butlery
M
5

According to the AMP project FAQ you cannot:

By using the AMP format, content producers are making the content in AMP files available to be cached by third parties.

As a content producer I dislike Google adding their own URL, and branding around my content... From the consumer perspective looks like the content comes from Google. They say it is to improve speed, but you can see Google's intention behind this "free" technology.

Manheim answered 17/2, 2017 at 18:53 Comment(4)
Surely if you add a disallow in your robots.txt, you can stop bots from crawling your AMP pages and caching them? This gives you the choice as a creator to have AMP pages, without the AMP cache.Rothermere
But they will not be cached by the network or promoted on the search results which defeats the purpose...Manheim
Hmm. I'm sure I heard somewhere that you can opt out of the various caches. It would mean that your content wouldn't be promoted (with the lightning bolt on Google results) but you could still benefit from AMP. However, I'm struggling to find a way to opt out.Rothermere
@Harvey Did you by any chance find that information?Carolacarolan
R
2

A simple hack is to keep using AMP guidelines for the speed it provides to the page, but violate one rule (like add you own javascript that does noting).

Once pages have an error, google will not cache them.

Rucksack answered 11/6, 2018 at 20:41 Comment(1)
Seems simple but they will still get indexed?Lovage
S
2

By publishing AMP pages you let Google or any other AMP cache store and deliver your web page (which surprisingly seems to be legal):

Caching is a core part of the AMP ecosystem. Publishing a valid AMP document automatically opts it into cache delivery. (https://www.ampproject.org/docs/fundamentals/how_cached)

To stop AMP from caching, the project recommends to invalidate the format by removing the amp attribute from the <html> tag. I propose something else.

One thing I always disliked about AMP ist that it requires you to embed the JavaScript code directly from their server (https://cdn.ampproject.org/v0.js), effectively telling AMP about every single visitor to every AMP page. Embedding the code from your own server stops this privacy issue, disables caching, and still gives you the framework.

To do so you can build your own AMP framework using the source code:

https://github.com/ampproject/amphtml

But it's much simpler to just copy v0.js and all the scripts it fetches to your own server.

Sisterly answered 20/9, 2018 at 10:39 Comment(0)
C
0

Odd because google says to remove the "amp" from the tag to not cache. It said nothing about loading the js locally.

https://amp.dev/documentation/guides-and-tutorials/learn/amp-caches-and-cors/how_amp_pages_are_cached/

Is google wrong?

Carolinecarolingian answered 23/9, 2022 at 16:15 Comment(1)
I do not see how this answers the question at the top of this page, but it should. Please edit according to How to Answer or delete the answer. Otherwise it risks being flagged as "not an answer" and being deleted.Josephina

© 2022 - 2024 — McMap. All rights reserved.