我可以强制刷新一个Facebook对象的图像URL吗? [英] Can I force a refresh of a Facebook Object's image URL?

查看:120
本文介绍了我可以强制刷新一个Facebook对象的图像URL吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

可以重新生成数据,但是我一直不成功(只有在对象是自托管的情况下才可以查看数据,是否正确?)。



还有一些关于在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]

另外

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

全部无效。



最后,有没有人知道缓存是否正常刷新?或者预期图像将永远持续吗?

解决方案

此文档说:

 更新对象

当一个动作被发布,或者一个Like按钮指向被点击的对象时,Facebook将刮擦对象的HTML页面并读取元标记。对象scrape也发生在以下情况下:

对象URL在Object Debugger中输入
第一次刮擦后每7天
当应用程序触发使用API​​端点的Scrape

这个Graph API端点只是一个调用:

POST /?id = {object-instance-id或object-url}& scrape = true

当你这样做 scrape = true 到og:url参数,并删除本网站上的所有og参数。因此,请确保此页面(og:url)具有适当的og:image元标记与新的图像url。



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


I have several objects hosted by Facebook that are posted to users' activity logs. The URL for the image is pointed to our content delivery solution, which redirects to a versioned image. This means that the URL can stay constant, but the image might change.

As you can see in this image

when the image changes, Facebook can still load it correctly (see the og:image column), but the image created in the actual post (see the hover text, which comes from https://fbexternal-a.akamaihd.net/safe_image.php) seems to be cached. I have found that changing the URL by adding a dummy parameter works (and we can do that if necessary), but if there's a way to force Facebook to refresh its cached image, that would be better. Does such a call or method exist?

In similar questions, I have heard that POST calls to

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

can rescrape the data, but I have been unsuccessful with that call (it appears to only scrape the data if the object is self-hosted, is that right?).

There was also something about adding fbrefresh=[ANYTHING] to the URL, but it sounds like that is equivalent to adding a dummy parameter.

Also, using the debugger does not seem to do anything either. I have entered tried:

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

Also

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

All to no avail.

Lastly, does anyone know if/when the cache might be refresh normally? Or would it be expected that the image persists forever?

解决方案

This document says:

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

When you do this scrape=true thing, facebook will go to the og:url parameter and scrape all og parameters on this site. So make sure that this page (og:url) has the appropriate og:image meta tag with the new image url.

If you update the image, you've to rename it (update og:image url) otherwise facebook doesn't know that you've a new image.

这篇关于我可以强制刷新一个Facebook对象的图像URL吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆