Title: Problems with CDN
Last modified: September 1, 2016

---

# Problems with CDN

 *  [brenolara](https://wordpress.org/support/users/brenolara/)
 * (@brenolara)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problems-with-cdn/)
 * Hi there,
 * I have just tried to use your plugin, but I have failed to make it work. Activating
   the plugin broke my site.
 * I would like to report my experience, so you guys can improve this amazing plugin.
 * I have some complex plugins running on my site, but the setup have been working
   fine for some years. The main beasts are: W3 total cache, BPS Security, BWP Minify.
 * As soon as I deployed the Adaptive Images code into my htaccess, my site broke
   down. In fact, It started to block all my cdn requests and my user was getting
   a 502 response, when trying to load some important files. Turning the CDN off
   would make the site go live again.
 * I work with w3 total cache to handle MaxCDN. I use multiple subdomains to deliver
   my files. For example: cdn.mydomain…. cdn1.mydomain…. cdn2.mydomain and so on.
   Could that multiple subdomains be the source of the issue?
 * Best regards
 * [https://wordpress.org/plugins/adaptive-images/](https://wordpress.org/plugins/adaptive-images/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Takis Bouyouris](https://wordpress.org/support/users/nevma/)
 * (@nevma)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problems-with-cdn/#post-7700392)
 * Hello, there,
 * Thank you very much for trying out our plugin and reporting these issues! I am
   really sorry to hear that our plugin broke down your website and I would like
   to try to get to the bottom of this.
 * First of all, I must say that CDN support is inherently “tricky” in what we are
   trying to accomplish. Actually, what a CDN does comes to some kind of conflict
   with our plugin. (Well, not exactly a conflict but…) The thing is that, in order
   to serve resized images, our plugin needs to serve the images itself! When the
   CDN comes in the middle, then our plugin has to instruct the CDN to serve the
   resized versions of images itself. This little bit is not easy to accomplish 
   in an unobtrusive and transparent. (And being unobtrusive and transparent is 
   a major principle of our plugin!)
 * Anyhoo, this sort of sums up why CDN support is indeed tricky in our case and
   why this feature is still experimental.
 * If I may ask, did your htaccess get updated automatically by the plugin or did
   you have to do this manually? Also, could you send me the part of the htaccess
   file that our plugin inserted, so I can check it out?
 * You see, the worst thing that is supposed to happen when our plugin works with
   a CDN is to simply not accomplish much -or even accomplish nothing at all- but
   it should not break anything, unless something really weird is going on.
 * Cheers,
    Takis
 *  Thread Starter [brenolara](https://wordpress.org/support/users/brenolara/)
 * (@brenolara)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problems-with-cdn/#post-7700418)
 * Hello,
 * Thank you for you kind support. I can’t even imagine the challenges you face 
   in order to make the plugin work in an unobtrusive and transparent way.
 * In my case, I have two plugins inserting codes in the htaccess file: BPS Security
   anb W3 total cache. I don’t know if Adaptive Image conflicted with one of them.
   We know for sure that files delivered via CDN were blocked all of a sudden, but
   files delivered via the main server were ok.
 * My htaccess is blocked by default. All I had to do was unblock the htaccess and
   the plugin was able to insert the code by itself. That’s was the moment my site
   broke down.
 * I got a little desperate at the moment and I did not save a copy of my htaccess,
   since I did not suspect it was the problem at that very instant.
 * I plan to try the plugin again with minification turned off, but test it in late
   hours, when there is less visitors online. Then, I will save the htaccess file
   and inform you guys.
 * Best Regards
 *  Plugin Author [Takis Bouyouris](https://wordpress.org/support/users/nevma/)
 * (@nevma)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problems-with-cdn/#post-7700451)
 * Hello, again,
 * If you could actually do the experiment once again, then perhaps we could trace
   the problem! As I said before, the worst that is supposed to happen is images
   not being resized and be served in their actual sizes. Which is at least not 
   catastrophic!
 * Other that, what our plugin does usually does not mix with what other plugins
   do in the htaccess file.
 * I will be waiting for your tests.
 * Cheers,
    Takis
 *  Thread Starter [brenolara](https://wordpress.org/support/users/brenolara/)
 * (@brenolara)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problems-with-cdn/#post-7700560)
 * Hi there,
 * I have just given it another try. I was able to activate the plugin along with
   all my other plugins, but it didn’t work. But it worked for a brief moment and
   I have no idea why.
 * So, I can give you my feedback.
 * 1. Image Sizes
 * My Adaptive Images setup was: 75% quality and Retina display checked.
 * I use an app called JPEGmini in order to optimize image sizes before uploading
   them to my WordPress post. With that, I get smaller images without compromising
   quality.
 * The problem was that the images created by Adpative Images plugin, even with 
   75% quality, ended up being larger or almost the same size as the orginial image.
 * I upload images with 800px width by default. For the brief moment it worked, 
   adaptive images only created 640px images. I do not know if the 480px would have
   been smaller.
 * 2. CDN
 * The plugin was able to add a string at the end of **some** image files. Please,
   see an example [here](http://www.limaonagua.com.br/wp-content/uploads/2016/08/CDN-problem.jpg).
 * However, the image source was wrong. I guess we may instruct W3 Total Cache to
   deliver the files in the “cache/adaptive-images” folder via CDN, but it would
   require some aditional configuration.
 * Best Regards
 *  Plugin Author [Takis Bouyouris](https://wordpress.org/support/users/nevma/)
 * (@nevma)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problems-with-cdn/#post-7700570)
 * Hello, again,
 * Thank you for the comprehensive feedback!
 * 1. Image sizes
 * We are using the GD PHP library which is inherent in most LAMP setups and web
   hosting environments. It will never produce such optimized compression results
   compared to tools like JPEGmini, but it usually does it fairly well.
 * Are you sure that even the resized versions, which our plugin produced, were 
   bigger in file size than the original images from JPEGMini? That would be so 
   strange indeed! I would really appreciate it if you could send me one of these
   images to test myself.
 * 2. CDN
 * What you point out most correctly in your screenshot, is the exact reason why
   our plugin support is mentioned as “still experimental”. We used a Javascript
   technique where -in your example- the first image was handled by our plugin before
   actually loading, but the second one did manage to load in its original size,
   so the plugin decided to just leave it be.
 * Now, what we could troubleshoot here is why the CDN did not deliver the image
   with the `?resolution=360,3` part in its `src` attribute.
 * One culprit might be the CDN itself! Does it have an issue with adding url parameters
   to image sources? This should be escalated to the support people of the CDN.
 * The other culprit could of course be the Adaptive Images plugin. There is a way
   to test this though, by simply making a direct request for that image with the
   url parameters, via your actual domain and not the CDN’s subdomain. If the image
   is actually delivered correctly, then the plugin works fine and the problem is
   with the CDN. And vice versa!
 * —
 * I am sorry for putting you through all this trouble and I would totally understand
   it if you are fed up with it already, but it really helps me investigate edge
   cases and I do appreciate it!
 * Also, I am preparing a next version where the CDN support will be handled totally
   differently. It is still in beta, but if you have the spare time, I could send
   it to you for debugging.
 * Cheers,
    Takis

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Problems with CDN’ is closed to new replies.

 * ![](https://ps.w.org/adaptive-images/assets/icon-256x256.png?rev=1138642)
 * [Adaptive Images for WordPress](https://wordpress.org/plugins/adaptive-images/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/adaptive-images/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/adaptive-images/)
 * [Active Topics](https://wordpress.org/support/plugin/adaptive-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/adaptive-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/adaptive-images/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Takis Bouyouris](https://wordpress.org/support/users/nevma/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/problems-with-cdn/#post-7700570)
 * Status: not resolved