Facebook在尝试共享页面时会记住以前的图像

时间:2015-02-25 23:09:23

标签: facebook asp.net-mvc-5 metadata

这让我很精神!我有一个页面上有一个分享按钮,为了论据的缘故,我在控制器中硬编码了图像名称和标题,如下所示

 public ActionResult ThankYou()
    {
        var model = new LabCombination
        {
            ImageCombination = "danone_ultimate_coconut_vanilla.png",
            ImageTitle = "danone_ultimate_coconut_vanilla"
        };

        return View(model);
    }

在我看来,我这样做

  <meta property="og:title" content="Check out the flavour I just made! @Model.ImageTitle" />
  <meta property="og:description" content="Check out the flavour I have just created!" />
  <meta property="og:image" content="http://danone.staging-eurorscg.com.au/Content/Images/FlavourLab/CombinationSmall/@Model.ImageCombination" />
  <meta property="og:url" content="http://danone.staging-eurorscg.com.au/thank-you" />

呈现如下

 <meta property="og:title" content="Check out the flavour I just made! danone_ultimate_coconut_vanilla" />
 <meta property="og:description" content="Check out the flavour I have just created!" />
 <meta property="og:image" content="http://danone.staging-eurorscg.com.au/Content/Images/FlavourLab/CombinationSmall/danone_ultimate_coconut_vanilla.png" />
 <meta property="og:url" content="http://danone.staging-eurorscg.com.au/thank-you" />

当我做facebook刮刀时,我看到了这一点 enter image description here

然而,当我转到页面的新闻分享时,我看到了这个

enter image description here

为什么facebook不爽快!我在浏览器中清除了缓存!

您可以在此处废弃该页面

https://developers.facebook.com/tools/debug/og/object/

使用以下网址

http://danone.staging-eurorscg.com.au/thank-you

任何帮助将不胜感激

**更新**当我动态设置计量数据时,它会缓存原始信息,如图所示,您在屏幕中间看到的内容,即图像也应显示在共享对话框中

enter image description here

我的Meta数据看起来像这样

 <meta property="og:title" content="Check out the flavour I just made! Strawberry &amp; Honey" />
<meta property="og:description" content="Check out the flavour I have just created!" />
<meta property="og:image" content="http://danone.staging-eurorscg.com.au/Content/Images/FlavourLab/CombinationSmall/danone_ultimate_strawberry_honey.png" />
<meta property="og:url" content="http://danone.staging-eurorscg.com.au/thank-you" />

如您所见,它具有所有正确的元数据。

3 个答案:

答案 0 :(得分:0)

这是因为您的分享按钮正在尝试分享网址http://danone.staging-eurorscg.com.au/flavour-lab而不是http://danone.staging-eurorscg.com.au/thank-you

答案 1 :(得分:0)

使用当前纪元时间添加以下og元标记:

<meta property="og:updated_time" content="1431713584" />

答案 2 :(得分:0)

您可以强制Facebook使用调试工具更新其缓存。它曾经被称为url linter。

https://developers.facebook.com/tools/debug/