• Resolved Martin Bailey

    (@martin_bailey)


    Since moving to LiteSpeed Server and the LiteSpeed Cache Plugin a few weeks ago, I have been seeing problems with the Featured Image not being recognized by Facebook when I post notifications of new articles.

    Today, I tried turning off the CDN and flushing my caches, and after I did so, Facebook had no problems with the images. This led me to find another curious issue which I think might be behind this.

    I noticed that images that I am embedding into posts since switching to LiteSpeed and your plugin all seem to be being embedded with the full URL including the cdn subdomain. In earlier posts, when I click on an image and check it’s URL, the media is linked from my domain https://martinbaileyphotography.com/ but for the last few posts, the images are being linked from https://cdn.martinbaileyphotography.com/ including the cdn subdomain.

    I believe this is not how this should work, and what is causing the problems with my featured images on Facebook. The major issue I see with this is that I might at some point stop using a CDN or have to turn it off for troubleshooting, but if the images embedded in my posts are hard-coded with the subdomain, the images will not load under these conditions.

    Also, of course, I cannot be turning my CDN on and off each week to trick Facebook into correctly including my images, and I will also have broken images whenever anyone else links to my posts, and it looks terrible.

    For your reference, here is a link to the fb developer website for a post that still has the problem: https://developers.facebook.com/tools/debug/sharing/?q=https%3A%2F%2Fmbp.ac%2F669

    So, I want to ask, is this the way that embedding images is intended to work with LiteSpeed Server and your plugin? If it is, do you not see this as an issue? Are other people not having problems also? If it is not, can you think of a reason why my blog is working this way since I started to use your plugin?

    Regards,
    Martin.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 26 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    You mean , when use CDN , you got problem with Facebook ? and once you turned off CDN, the issue is gone ?

    Best regards,

    • This reply was modified 5 years, 4 months ago by qtwrk.
    Thread Starter Martin Bailey

    (@martin_bailey)

    Yes, but as I explained, I believe the problem may be caused by the deep linking in my WordPress posts. I’d really like help/advice on both sides of this if possible.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Yes, I’d like to help you out , but I am still trying to understand the issue here.

    https://developers.facebook.com/tools/debug/sharing/?q=https%3A%2F%2Fmbp.ac%2F669

    I didn’t see any issue with images in this link.

    is this the way that embedding images is intended to work with LiteSpeed Server and your plugin

    Could you please explain how would you like to embed the images?

    Best regards,

    Thread Starter Martin Bailey

    (@martin_bailey)

    Aah, I actually opened the post while the CDN was off and saved it, so it seems that the issue is no longer occurring, but it will happen again when I create and release next week’s post.

    The error I was seeing was this, for this week’s post, so a different image, but the same issue:
    Provided og:image, https://cdn.martinbaileyphotography.com/wp-content/uploads/2019/05/Marc_Silver_Interview_Featured.jpg could not be downloaded. This can happen due to several different reasons such as your server using unsupported content-encoding. The crawler accepts deflate and gzip content encodings.

    I initially tried changing my headers to gzip, deflate etc. but nothing worked. The only way I could get around the issue was to turn off the CDN. Thinking about it, I also went into my posts and reselect the images, then saved the posts, so that they did not have the cdn subdomain in the image URLs.

    If you can tell me, if it is normal for images to be embedded using the cdn URL or not, that would initially be a big help. Here is a screenshot of the media link of an image in one of my recent posts: https://www.dropbox.com/s/nuxp4q0zbfqbfzl/Image_Links.jpg?dl=0

    Should this be happening?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Provided og:image, https://cdn.martinbaileyphotography.com/wp-content/uploads/2019/05/Marc_Silver_Interview_Featured.jpg could not be downloaded. This can happen due to several different reasons such as your server using unsupported content-encoding. The crawler accepts deflate and gzip content encodings.

    LSCWP only alters the link from https://domain.com/path/to/image.jpg to https://cdn.domain.com/path/to/image.jpg

    in your HTML source code.

    It does not change anything else besides the URI path.

    And the link you provided resutls in 404 error , I guess that’s why it couldn’t download ?

    View post on imgur.com

    So is the origin

    View post on imgur.com

    Best regards,

    Thread Starter Martin Bailey

    (@martin_bailey)

    Sorry about the 404 error. I got the error message from my clipboard history, and the link was before I reuploaded the image earlier. Forget about the 404 error. That was not happening when I had the issue earlier. My bad.

    But, the error message is what I was seeing, and is a real issue that won’t go away without your help.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    I think LSCWP only changes the URI path from domain.com to cdn.domain.com , which doesn’t alter anything else.

    When you set up the featured image, were you directly using the CDN URI or Origin URI ?

    Best regards,

    Thread Starter Martin Bailey

    (@martin_bailey)

    I was just inserting images using the regular WordPress Media Library, but they are being linked to the cdn subdomain.

    Because I already saved the the last few posts with the CDN turned off, I can’t check again, but I have a test page that I just embedded an image into, and then checked my database directly, and found that the image is indeed embedded using the cdn subdomain in the URL. Here is the code from my database:

    <!-- wp:paragraph -->
    <p>This is a test image in a test post.</p>
    <!-- /wp:paragraph -->
    
    <!-- wp:image {"id":302083,"linkDestination":"media"} -->
    <figure class="wp-block-image"><a href="https://cdn.martinbaileyphotography.com/wp-content/uploads/2019/07/MBP_Namibia_20190616_MR12152.jpg"><img src="https://martinbaileyphotography.com/wp-content/uploads/2019/07/MBP_Namibia_20190616_MR12152-1440x960.jpg" alt="Sleeping Lion" class="wp-image-302083"/></a><figcaption>A lion sleeping peacefully in the Etosha National Park, Namibia</figcaption></figure>
    <!-- /wp:image -->
    
    <!-- wp:tadv/classic-paragraph /-->

    This surely shouldn’t be how this works? What happens whenever I turn off or stop using the CDN?

    Regards,
    Martin.

    Thread Starter Martin Bailey

    (@martin_bailey)

    Note that I actually select to link to the Media File when I embed images, as over the years some Lightbox plugins have not displayed images if you don’t do this. It’s just a regular WordPress option though. Nothing special.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Yes, from what I understand , it shouldn’t do CDN replacement in editor mode , I will run some test and get back to you.

    Best regards,

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    I can not reproduce it.

    I set up a WP site , install LSCWP and set up CDN.

    when I use the default editor to edit post/insert image, and then check database as you did , it was using the origin URI.

    Could you please double check?

    If persist, please try add action=edit (which is query on editor) into tab 6 , URI exclud to see how it goes ?

    Best regards,

    Thread Starter Martin Bailey

    (@martin_bailey)

    Are you using the Gutenberg editor, adding an Image block or drop the image into the post/page editor, then select the Media File under the Link To pulldown, as in my screenshot?

    https://www.dropbox.com/s/nuxp4q0zbfqbfzl/Image_Links.jpg?dl=0

    I tried adding action=edit to the URI Exclude field as you suggested, but nothing changes. When I select Media File to link to, the image URL incorrectly contains the cdn subdomain and this is stored in the post body in the database.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Oh yes , now I get it , I am able to reproduce the issue now.

    Thanks for the tip , will investigate it further.

    Best regards,

    Hi @martin_bailey, we’ve fixed this issue, please try to install our latest commit on LiteSpeed Cache > Debug page. Please feel free to let us know if you have any questions. Thanks.

    Thread Starter Martin Bailey

    (@martin_bailey)

    Thanks for letting me know Stanley, but I cannot find an option to upgrade.

    I do see at the top of the page that I’m still at v2.9.8.4, so it has not been automatically upgraded.

    Can you tell me what I’m looking for? There is nothing that says upgrade etc. on the LiteSpeed Cache > Debug page.

    Regards,
    Martin.

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Image Linking and Facebook Issues with CDN Turned On’ is closed to new replies.