Search code examples
htmlfacebookmeta

preview picture on facebook works "times through time"


I try to add my link to a facebook page. Sometimes facebook loads preview picture, sometimes not (even don't try to load and just add as link, without preview picture). My code has the following lines in head section:

<meta property="og:title" content="[title]" />
<meta property="og:description" content="[text]" />
<meta property="og:image" content="[correct_link_to_image]" />

all pages have format like

[MY_ADDRESS]/jpg/[UNIQUE_CODE].html 

links for images have format:

[MY_ADDRESS]/publicThumb/[UNIQUE_CODE].JPG 

So, each unique page has unique image My thoughts - it happened because Facebook caches it. But how to solve?

Thanks


Solution

  • I solved my problem.

    First at all, facebook proposes us a special debug tool

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

    If you enter the url to check and click on "Fetch new scrape information" and receive all detailed information, including page error (this was my case, I asked Request.UserLanguages on page and this is empty for Facebook's request, so, Facebook got an error).

    Secondly, need to add og:url meta tag (this tag is mandatory to correct work)

    Thirdly, og:image should be at least 200x200, otherwise Facebook try to catch any other picture on page

    P.S. Seems, russian social network "VKontakte" uses the same tags as Facebook