简体   繁体   中英

Unable to remove page from Google Amp cache

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM