How to force update AMP Cache for WordPress

  • by
update amp cache

One of the best ways to speed up your WordPress website is to use AMP. AMP creates a cached version of your WordPress posts or pages on Google servers for fast loading. But what if you wanted to force update AMP cache? In this guide we will teach you how to do that.

How does AMP Cache work?

Google explains how AMP Cache works:

“The Google AMP Cache is a cache of validated AMP documents published to the web that is available for anyone to use. Google products, including Google Search, serve valid AMP documents and their resources from the cache to provide a fast user experience across the mobile web.”

So what does this really mean in a WordPress environment? Let us break it down into steps:

  • You would publish a post/page on your WordPress website
  • The AMP Plugin will create an AMP specific URL
  • Content will be pushed to the AMP specific URL and cached

How the AMP Cache works

Here are a few interesting facts about how AMP Cache works

  • When a user requests an AMP document from the Google AMP Cache, the cache automatically requests updates in order to be able to serve fresh content for the next user once the content has been cached. With this model, updates to AMP documents propagate automatically and quickly; few users will see the non-updated version after your update.
  • The cache follows a “stale-while-revalidate” model. It uses the origin’s caching headers, such as Max-Age, as hints in deciding whether a particular document or resource is stale. When a user makes a request for something that is stale, that request causes a new copy to be fetched, so that the next user gets fresh content.
  • To limit the amount of load it generates for publisher sites, the Google AMP Cache considers any document fresh for at least 15 seconds, and any resource fresh for at least 1 minute. Note that those numbers may change in the future, as we tune the cache for optimum balance between freshness and load on publisher sites.

How to force update AMP cache for WordPress

Copy AMP Cache URL template

https://cdn.ampproject.org/c/s/WordPressURLwithoutHTTPS/amp/

Now pick a WordPress post for which you want to update the AMP Cache, for example we will pick our WordPress guide on how to generate a text sitemap with WordPress that has the following URL

https://awsmtips.com/text-sitemap-in-wordpress/

Now we will remove the https:// part and enter URL in the template above so it looks like this:

https://cdn.ampproject.org/c/s/awsmtips.com/text-sitemap-in-wordpress/amp/

Now just load the URL in a Chrome incognito window and hit enter so the cache is forced to update.

That’s it. That is a simple yet effective way to update the AMP Cache on WordPress that does not require any complex solution.

Feel free to check our WordPress category where we will be posting other solutions related to WordPress or post a comment below if you have a question.

Leave a Reply