动态图像的Facebook Opengraph og:图像元标记 [英] Dynamic Image for Facebook Opengraph og:image meta tag

查看:166
本文介绍了动态图像的Facebook Opengraph og:图像元标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Facebook上分享我的网站上的图片。图像可以是动态的,但其他元数据将保持不变。

I am trying to share an image from my website on facebook. The image can be dynamic, but other meta will remain the same.

有没有办法可以在OG:IMAGE标签中拥有动态数据,否则我必须去与FB Post API的其他选项。

Is there a way I can have dynamic data in OG:IMAGE tag, or will I have to go with the other option of FB Post APIs.

推荐答案

是和否。 Facebook一旦浏览您的网站,并缓存了它所发现的元数据,除非你特别去 here 并强制刮刀再次抓取您的网站。缓存通常会过期(可能是在1-2天之后?),所以如果在这个缓存期之外再次请求,Facebook将再次抓取该站点。

Yes and no. Facebook scrapes your site once, and cached the metadata that it finds, unless you specifically go here and force the scraper to crawl your site again. The cache does generally expire (perhaps after 1-2 days?), so when requested again outside of this cache period, Facebook will crawl the site again.

您可以一个动态生成的 og:image 元标记,但它只会读取一个时间(每个缓存期),只有那个图像将被保存。

You can have a dynamically generated og:image meta tag, but it will only be read the one time (per cache period), and only that instance of the image will be saved.

例如,如果用户A共享您的页面,并且您的页面返回 imageA.png og:image 标签中,那就是与页面元数据相关联的图像。

For example, if user A shares your page, and your page returns imageA.png in the og:image tag, then that is the image that will be associated with your page's metadata.

如果用户B然后在相同的缓存期限内共享相同的页面,Facebook将放弃元数据抓取,并假设 imageA.png 仍然是有效的 og:image

If user B then shares the same page within the same cache period, Facebook will forgo the metadata scraping and assume that imageA.png is still a valid og:image.

这篇关于动态图像的Facebook Opengraph og:图像元标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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