Support » Plugin: W3 Total Cache » Use CDN media URLs in Post Editor

  • Resolved Danny Santoro

    (@danielsantoro)


    Automattic Happiness Engineer

    Hi there,

    I’m running into a weird situation with a multisite. In short, all of the images are pulling from the same S3 bucket and that works great for displaying them on the frontend and in the Media Library. However, when someone is authoring a post the image does not display in the editor because it’s looking for the origin files.

    As an example, here would be the URL where you can find the image and what is displayed on all of the frontends:

    example.com/wp-content/uploads/sites/6/2020/10/just-a-picture.jpg

    In the post editor, it’s looking for:

    example.com/siteslug/wp-content/uploads/sites/6/2020/10/just-a-picture.jpg , which doesn’t exist at that path since it’s uploaded directly to S3.

    Is there some way I can force the WordPress editor to omit the site slug in the URLs so it uses the CDN url for an upload?

    Thank you!

    • This topic was modified 5 months, 1 week ago by Danny Santoro. Reason: typo
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @danielsantoro

    Thank you for your inquiry and I am happy to assist you with this.
    Just to confirm, the media you are referring to does not exist on your server only on S3?
    Is the option “Use CDN links for the Media Library on admin pages” enabled in Performance>CDN>Advanced?
    Thanks!

    Thread Starter Danny Santoro

    (@danielsantoro)

    Automattic Happiness Engineer

    Hi @vmarko – sorry for the delay, my email decided to act up and I didn’t see it come through.

    You are correct, the media doesn’t stay on the server after it’s uploaded so all of our media library is in an S3 bucket.

    I have “Use CDN links for the Media Library on admin pages” selected. This makes it so the images appear when I go to view the Media Library – it’s pulling the correct URL (without the site slug). It seems to be only in the post editor where the images don’t appear since it keeps adding the site slug before /wp-content/....

    Thanks in advance!

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @danielsantoro

    Thank you for the information.
    It sounds like a change in the editor. Are you using the new block editor or the old classic editor? Where is “site slug” coming from? Is it multisite?
    Thanks!

    Thread Starter Danny Santoro

    (@danielsantoro)

    Automattic Happiness Engineer

    I’m using the new Block Editor, and yes, it’s a multisite with the folder structure so things like example.com/site1/ and example.com/site2/

    Thank you!

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @danielsantoro

    Thank you for the information.
    Are you using CDN for each site individually or are you sing a single configuration for all websites?
    Thanks!

    Thread Starter Danny Santoro

    (@danielsantoro)

    Automattic Happiness Engineer

    Hi @vmarko,

    I apologize for the delay, I got sidetracked and dropped the ball on responses here. I am using one configuration file since the number of sites is pretty high – it would be very unwieldy to have a separate configuration per site.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.