我可以强制刷新Facebook对象的图片网址吗?

Roa*_*-EX 2 caching facebook image opengraph

我有几个由Facebook托管的对象,这些对象被发布到用户的活动日志中.图像的URL指向我们的内容交付解决方案,该解决方案重定向到版本化的图像.这意味着URL可以保持不变,但图像可能会更改.

正如您在此图片中看到的那样

对象浏览器中的图像不一致

当图像发生变化时,Facebook仍然可以正确加载它(参见og:image列),但在实际帖子中创建的图像(参见悬停文本,来自https://fbexternal-a.akamaihd.net/safe_image .php)似乎是缓存的.我发现通过添加虚拟参数来更改URL是有效的(如果需要,我们可以这样做),但如果有办法强制Facebook刷新其缓存图像,那就更好了.这样的电话或方法是否存在?

在类似的问题中,我听说POST呼叫

https://graph.facebook.com/?id=[ID]&scrape=true
Run Code Online (Sandbox Code Playgroud)

可以重新调整数据,但我没有成功调用该调用(如果对象是自托管的,它似乎只会抓取数据,是吗?).

还有一些关于向URL添加fbrefresh = [ANYTHING],但听起来这相当于添加一个虚拟参数.

此外,使用调试器似乎也没有做任何事情.我已尝试进入:

- http://developers.facebook.com/tools/debug/og/object?q=[ID]
- http://developers.facebook.com/tools/debug/og/object?q=[ID]&refresh=[ANYTHING]
- http://developers.facebook.com/tools/debug/og/object?q=[Image URL]
- http://developers.facebook.com/tools/debug/og/object?q=[Image URL]&refresh=[ANYTHING]
Run Code Online (Sandbox Code Playgroud)

- http://graph.facebook.com/?id=[ID]&scrape=true
Run Code Online (Sandbox Code Playgroud)

一切都无济于事.

最后,是否有人知道缓存是否正常刷新?或者预计图像会永远存在?

Jur*_*rik 6

该文件说:

Updating Objects

When an action is published, or a Like button pointing to the object clicked, Facebook will 'scrape' the HTML page of the object and read the meta tags. The object scrape also occurs when:

    The object URL is input in the Object Debugger
    Every 7 days after the first scrape
    When an app triggers a scrape using an API endpoint

This Graph API endpoint is simply a call to:

POST /?id={object-instance-id or object-url}&scrape=true
Run Code Online (Sandbox Code Playgroud)

当你这样做时scrape=true,facebook将转到og:url参数并在此站点上刮取所有og参数.因此,请确保此页面(og:url)具有带有新图像URL的相应​​og:image元标记.

如果您更新图像,则需要重命名它(更新og:图像网址),否则facebook不知道您有新图像.