WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
[resolved] MaxCDN Sub-Directory Images Not Being Pulled Completely (6 posts)

  1. laurenng
    Member
    Posted 5 months ago #

    Greetings!

    I've been equiping up my multisite installation with MaxCDN and have had a wonderful time getting set up and support for my main domain (infinite.nu). However, a secondary install (infinite.nu/oncecoupled mapped to oncecoupled.com) was not showing any images as being hosted at the CDN.

    I read some other forums and found a partial solution: if I add "{wp_content_dir}/uploads/sites/*" to my custom file list in the CDN settings, my in-post images will now be pulled properly.

    However, featured images or imgs in my sidebar are still a problem. I've tried changing the custom feed url to "{wp_content_dir}/uploads/*" or "{wp_content_dir}/uploads/sites/#/*" with no luck.

    I've even found some code that could work but it's for WP Super Cache and anyway, I'd rather not edit the plugin as it will be lost in an update (/I don't know what I'm doing and will probably break it): http://wordpress.org/support/topic/wp-super-cache-multisite-with-cdn?replies=5

    I would appreciate any suggestions that could be made - for me to try, or even just learn more about. I've exhausted all search terms I can come up with and definitely need some more reading material. :)

    Thanks!
    Lauren

    https://wordpress.org/plugins/w3-total-cache/

  2. Will Mayall
    Member
    Posted 5 months ago #

  3. laurenng
    Member
    Posted 5 months ago #

    Hey @Will, thanks for sharing that thread with me!

    I feel conflicted, because I'm on multisite so my *installation* is technically in the root folder, though a site instance is also at /oncecoupled, so it seems as if these problems could be unique.

    Was your site also pulling some images, but not others? Since that's the only issue I'm having, it would certainly confirm the same problem is occurring.

    This definitely gives me some food for thought. I don't mind waiting on an update if that's the case - I've can stop pulling my hair out in frustration over this!

  4. Will Mayall
    Member
    Posted 5 months ago #

    My site works fine for images and content that comes from the "default" folders. But it does not work for anything that needs to be listed in the "custom files list".

    I created two identical sites to demonstrate the issue. The only difference between the sites was that one was not at the root level. That site did not have the URLs updated for the CDN.

    BTW. Remember to check the source code of the pages. That's the most reliable way to determine if W3TC is properly replacing the local URLs with the CDN URLs.

  5. laurenng
    Member
    Posted 5 months ago #

    Yes, the source code is how I know "in-post" images are being served by the CDN but "featured images" are not.

    The weird thing is that none of the images were being served until I added "{wp_content_dir}/uploads/sites/*" to the custom files list and now only some of those images are being served - even though they are located in the same folder. (Eg. uploads/sites/4/2014/02)

  6. laurenng
    Member
    Posted 5 months ago #

    RESOLUTION:

    After speaking with MaxCDN several times and receiving some absolutely wonderful advice from them, I noticed a pattern in the images that were or were not being served. (Staring at source code for hours on end and I hadn't noticed this yet?!)

    • The images that are replaced properly have the correct domain name: eg. "http://oncecoupled.com/wp-content/uploads/sites/4/2014/02/comments.jpg"
    • The images that are causing problems are using the correct sub-domain name: eg. "http://infinite.nu/oncecoupled/wp-content/uploads/sites/4/2014/02/post.jpg"

    With this realization, it seemed that domain mapping was *actually* what I needed to look in to. Armed with a new arsenal of search terms, I pretty quickly came across this: http://wordpress.org/support/topic/featured-image-paths-in-mapped-subdomains?replies=9#post-3906844

    Which, in short, is the solution! Click over there for the answer to both featured image paths in multisite mapped domains, edit media file urls in multisite mapped domains, and as a result of these, cdn images not being served properly.

Reply

You must log in to post.

About this Plugin

About this Topic