简体   繁体   English

使用通配符更新Google AMP缓存中的多个AMP页面

[英]Updating Multiple AMP Pages in Google AMP Cache using wildcard

我知道有一种方法可以通过向AMP Cache URL发送GET请求来更新amp内容,但是我想知道是否有可能通过在缓存URL中使用通配符来清除多个页面的缓存,还是我们必须一次清除一个文档,如果要处理数百万个页面,则可能需要很长时间。

The documentation does not indicate such method. 该文档没有指出这种方法。 I'm sure you've read that in the Remove AMP Content . 我确定您已经在“ 删除AMP内容”中阅读了该内容

Remove AMP content 删除AMP内容

Use the "update-ping" mechanism to permanently remove content from the Google AMP Cache after the content has been removed from its origin. 在将内容从其来源中删除后,使用“更新-ping”机制将其从Google AMP缓存中永久删除。 For example, to purge content formerly served at https://cdn.ampproject.org/i/s/example.com/favicon.ico , send an update ping request to: 例如,要清除以前在https://cdn.ampproject.org/i/s/example.com/favicon.ico内容,请将更新ping请求发送至:

https://cdn.ampproject.org/update-ping/i/s/example.com/favicon.ico . https://cdn.ampproject.org/update-ping/i/s/example.com/favicon.ico Cached content that no longer exists will eventually get removed from the cache; 不再存在的缓存内容最终将从缓存中删除; it's just faster to use "update-ping". 使用“ update-ping”更快。

Nowhere does it indicate that you can use wildcards. 它无处表明您可以使用通配符。

It sounds like you just need to put a mechanism in place that will update the cache after a page is updated. 听起来您只需要建立一种机制即可在页面更新后更新缓存。 Our 8 news sites are feed from a CMS. 我们的8个新闻站点均来自CMS。 I added a hook into the publish functionality that calls the "update-ping" api after a story is published or republished to makes sure that the page is cached or that the pages cache is up to date. 我在发布或重新发布故事后在“发布”功能中添加了一个钩子,以调用“ update-ping” api,以确保页面被缓存或页面缓存是最新的。

When a story is unpublished we clear the AMP cache for that page. 当故事未发布时,我们将清除该页面的AMP缓存。 If we did this by hand it would be a nightmare. 如果我们用手做这将是一场噩梦。 Try to tie it into the existing work flow your sites have for updating content. 尝试将其与您的网站用于更新内容的现有工作流程联系在一起。 Much more maintainable that way. 这样更易于维护。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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