was successfully added to your cart.

How to Update Google AMP Cache

by TJ Kelly Published Apr 9, 2017 · Last updated Apr 10, 2017 11,900 Views

Wondering how to update Google AMP Cache? It’s easy. And maybe unnecessary. Here’s how and why.

How to Update Google AMP Cache.So you’re using Google AMP. Cool, good for you. We do too. Just about everyone should.

So you hate the way your AMP pages look. Yea, we did too. Just about everyone should.

So you start messing with the design and layout and you finally get your Google AMP pages looking good.

All set, right?

Maybe not. We all know Google like to take its time on reindexing URLs. The same is true with AMP:

AMP URLs are cached. We don’t know when—or even if—the cache is refreshed on its own. YMMV. That’s because the AMP cache is updated on the fly, following a “stale-while-revalidate” model.

What does that mean?

Read on.

Update Google AMP Cache

If you’ve been googling queries like “how to flush Google AMP cache” or anything like that, you’ve probably seen this page:

Update Google AMP Content Documentation.

It’s Google’s documentation on AMP’s update-ping mechanism: it’s how you can force AMP to refresh its cache.

So let’s look at exactly how to do it. It takes a few steps, and they’re not all explained on the same website. So we’ve collected them for you. We got you, fam.

1. Copy AMP Cache URL

This the the magical URL that tells AMP to refresh its cache. It’s actually just the URL to show the cache, but because of that “stale-while-revalidate” model, it also triggers a cache update.

There are actually 2 ways to send that refresh command to AMP, one “stronger” than the other, but we’ll only need the first one.

Here’s what Google says:

The easiest way to update the version of any AMP document stored in the Google AMP Cache is to make a new request to access that document using the AMP Cache URL format.

Ok, so far so good. It makes you wonder what the AMP Cache URL format is, but we’ll get there.

Unsure if you got that AMP Cache URL right?

Use this free tool at ampbyexample.com.

Google AMP Cache URL Converter Tool.


2. Load your cached AMP page in a browser

It’s that simple.

Most people who understand AMP—beyond the typical “AMP is like faster mobile pages, right?” generic responses—will tell you that this is really all you need to do. The AMP cache updates when you complete this step. And for the most part they’re right.

AMP By Example: Update Cache.

Google’s documentation goes on to say…

The Google AMP Cache automatically requests the latest version of the AMP document from its origin…and serves the updated version to the next user.

There it is.

That means that when you load the AMP Cache URL directly, that forces the cache to update, even without the more “urgent” update ping method. No special command to run via an API somewhere. Just load the URL in a browser.

But there’s a catch.

3. Visit again in new tab, browser, or device

The cache will be refreshed but the new AMP page will be shown to the next user, not to you. This is what “stale-while-revalidate” means.

There’s an easy workaround, obviously. Make sure you ARE the next user. Just close the tab and reopen it, or access from a different browser/device, and you’re all set.

Google considers a document “fresh” for at least 15 seconds after it’s uploaded or edited, which means they won’t refresh the document until after that 15 seconds is over.

So be patient.

Meanwhile, on the internet

There’s some discussion on this topic at StackOverflow that may benefit readers of this blog too.

Update Google AMP: StackOverflow Answer.

User Dan Dascalescu’s answer is actually not the accepted “correct” answer, but it probably should be.

Update Google AMP: StackOverflow Wrong Answer.The accepted answer is wrong.

It says “no, there is no API to force a new copy of an AMP page in the Google CDN.” But that’s untrue, as we’re learning in this post and in Google’s documentation.

And the StackOverflow community knows it.

The green checkmark means it’s the “accepted” answer (marked by the author of the question). But the -1 means the rest of the StackOverflow who’ve voted on the answers know what this answer is junk.

Need a hand?

If you’re struggling with Google AMP, updates to the cache, removing your URLs from the index, or any of that, we can help!

Get in touch and we’d be happy to work through for (or with) you.

I need AMP help!

Bonus: DO NOT remove AMP URLs.

Unless you’re 100% sure that’s what you want to do, it’s a bad idea to remove your AMP URLs from the cache. If you do remove them, be very careful.

Again, Google says…

Important: Removal of content from the Google AMP Cache will not immediately cease traffic flowing to removed content, which may result in user-facing errors such as 404 or 500.

That’s a big deal. And there has been plenty of discussion about it since AMP came out (that post has 70,000+ views).

Update Google AMP: Remove URL Error.

Screenshot borrowed from shkspr.mobi.

Why? What’s the problem?

Well, it turns out that once your AMP pages are in the index, Google seems reticent to let go of them.

The documentation says clearly that even if you update ping remove them, they still take some time to disappear.

And even once that happens, the AMP error page links to the old, now-invalid /amp URL, returning a 404.

For example, Google Search may link to the AMP versions of pages even after you use “update-ping” to remove the page from the Google AMP Cache because the index still indicates that an AMP page is available and may take time to become aware of the removal.

Yes, you can add a redirect in your htaccess or with a plugin, but it shouldn’t be the author’s job to fix AMP’s mistakes.

AND, as pointed out by @edent in the link above, you have to run update ping individually on every URL. For some sites, that’s thousands of one-at-a-time update pings.

No thanks.

The smart money says stick with AMP unless you have good reason not to.

So should I update my AMP pages or not?

Now What?

Yes. The WordPress AMP plugin is a good start, but it’s lacking some important things like style options, social sharing buttons, and a link to the non-AMP version.

We’ve already had to retrofit some of our clients’ websites with those features because the AMP plugin isn’t good enough.

The update is easy if you know where to look.

As always, I wish Google would make their documentation a little clearer and easier to use.

Need a hand?

If you’re struggling with Google AMP, updates to the cache, removing your URLs from the index, or any of that, we can help!

Get in touch and we’d be happy to work through for (or with) you.

Step 1 of 2


Copy and paste this code to display the image on your site

How to Update Google AMP Cache

View Now