2

我有几个由 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

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

还有一些关于将 fbrefresh=[ANYTHING] 添加到 URL 的内容,但听起来这相当于添加了一个虚拟参数。

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

- 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]

- http://graph.facebook.com/?id=[ID]&scrape=true

一切都无济于事。

最后,有谁知道缓存是否/何时可以正常刷新?还是会期望图像永远存在?

4

1 回答 1

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

当您执行此操作时scrape=true,facebook 将转到 og:url 参数并抓取该站点上的所有 og 参数。因此,请确保此页面 (og:url) 具有适当的 og:image 元标记和新的图像 url。

如果您更新图像,则必须重命名它(更新 og:image url),否则 facebook 不知道您有新图像。

于 2013-11-13T11:39:23.047 回答