1
votes

I'm having trouble using Google's API to update amp pages from a site I'm working on. The site is a Wordpress based site using WP Amp to generate amp pages, it appends /amp to any enabled pages.

I've read the documentation here and it seems like it should be a simple GET request using this structure:

https://cdn.ampproject.org/update-ping/c/s/www.example.com/example-category/example-page/amp

..which gives me a 204 No Content reply (to be expected Google's docs say). However, when retesting via my phone (with cache cleared etc) it is showing the same old amp page not the updated one.

Surely I'm missing something obvious, look forward to finding out what it is.

1
Have you removed the document from the origin? - kul3r4
No, I've updated it on the origin though and this shows everywhere when connecting direct to that URL. Google though refuses to update its old copy. - d1ch0t0my
Could you share the link of the page? - kul3r4
There is also a new version of the update ping that requires RSA key developers.google.com/amp/cache/update-ping - kul3r4

1 Answers

0
votes

Figured this out finally after leaving it for a while and coming back to it.

The URL format for updating Google's cache is:

https://www-example-com.cdn.ampproject.org/c/s/www.example.com/example-category/example-page/amp

Google states that to update you need to have the /update-ping/ prefixing the /c/s switches but that never worked for me. After much trial and effort using the above format works for me every time.

If you run it in your browser expect to see the old version on first page load but if you refresh after that the updated amp page should show.