tpai
9/4/2017 - 2:25 AM

og protocol

og protocol

Scenario

Sometimes, facebook url debugger can not crawl exact meta data from the code like below and LINE neither.

<head>
  <meta httpEquiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Page Title</title>
  <!-- massive inline CSS style -->
  <style>...</style>
  <meta property="og:image" content="{image}" />
  <meta property="og:title" content="{title}" />
  <meta property="og:description" content="{description}" />
</head>

Solution

HTML5 specifies that any meta tag which is used to specify the character set must be within the first 1024 bytes of the file in order to take effect. -- Brian Campbell

I think other meta tag maybe has the same limit, so pull up the meta data before the inline massive css style, and... everything works well!

<head>
  <meta httpEquiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Page Title</title>
  <meta property="og:image" content="{image}" />
  <meta property="og:title" content="{title}" />
  <meta property="og:description" content="{description}" />
  <!-- massive inline CSS style -->
  <style>...</style>
</head>

Reference