Html 如何强制 Facebook 清除其缓存并使用共享网页的更新元描述?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9026448/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 22:07:36  来源:igfitidea点击:

How can I force Facebook to purge its cache and use newer meta description of a shared webpage?

htmlfacebookxhtml

提问by Semere Taézaz Sium

Facebook fetches the title and webpage description from the HTML header of the webpage whenever people share a link on Facebook. I realized that [I believe for performance purposes], Facebook caches and reuses the webpage title and description if more people share the same link over and over again. What if the webpage has a breaking news or something that is dynamically changes within a short period of time. Even worse, what if the page had wrong content and the webmaster made changes to it?

每当人们在 Facebook 上分享链接时,Facebook 都会从网页的 HTML 标题中获取标题和网页描述。我意识到 [我相信出于性能目的],如果更多人一遍又一遍地共享相同的链接,Facebook 会缓存并重用网页标题和描述。如果网页有突发新闻或在短时间内动态变化的内容怎么办。更糟糕的是,如果页面内容错误并且网站管理员对其进行了更改怎么办?

How can I force Facebook to flush its cache and update it with new content on the website?

如何强制 Facebook 刷新其缓存并使用网站上的新内容更新它?

回答by borisdiakur

The best way to do it is by using the Facebook debugger: http://developers.facebook.com/tools/debugInsert your url, let the debugger scrape your page and the cache is cleared.

最好的方法是使用 Facebook 调试器:http: //developers.facebook.com/tools/debug插入您的 url,让调试器抓取您的页面并清除缓存。

UPDATE:

更新:

As DMCS pointed out "some things cannot be updated after X number of likes". Here is the info in more detail taken from the Facebook documentation:

正如 DMCS 指出的“在 X 次点后无法更新某些内容”。以下是从Facebook 文档中获取的更详细信息:

Note: og:titleand og:typeare only editable initially - after your page receives 50 likesthe title becomes fixed, and after your page receives 10,000 likesthe type becomes fixed. These properties are fixed to avoid surprising users who have liked the page already. Changing the title or type tags after these limits are reached does nothing, your page retains the original title and type.

注意:og:title并且og:type最初只能编辑 - 在您的页面收到50 个赞后标题变为固定,并且在您的页面收到10,000 个赞后类型变为固定。这些属性是固定的,以避免让已经喜欢该页面的用户感到惊讶。达到这些限制后更改标题或类型标签没有任何作用,您的页面保留原始标题和类型。