Skip to content

Meta data is missing from the Facebook preview when sharing a page or post which is cached #248

@markhowellsmead

Description

@markhowellsmead

The meta data is missing from the Facebook preview when sharing a page or post which is cached. The Facebook Debugger shows the error message Curl error: 61 (BAD_CONTENT_ENCODING).

I copied out the HTML content to a static file in the webroot and shared this URL; it was correctly interpreted. Therefore, the content delivery from the cache is causing a problem. I traced the problem back to the following rules in the .htaccess file. If I comment these out, the Facebook Debugger can load the content correctly.

  # gzip
  RewriteRule .* - [E=CACHIFY_SUFFIX:]
  <IfModule mod_mime.c>
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteRule .* - [E=CACHIFY_SUFFIX:.gz]
    AddType text/html .gz
    AddEncoding gzip .gz
  </IfModule>

To Reproduce

  1. Publish a page or post and allow it to be cached as a static file on the server.
  2. Test the URL using https://developers.facebook.com/tools/debug/
  3. See the error Curl error: 61 (BAD_CONTENT_ENCODING)

Expected behavior
The usual Facebook preview of meta data (including post thumbnail) should be shared. The preview in the Facebook Debugger should not return any errors.

System (please complete the following information):

  • OS: all
  • Version: all

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions