Home > Programming, Servers & Scripts >

CDN Issues (Amazon S3/Cloudfront) (12)


03-03-2013 03:44 AM #1 zeno (Administrator)
CDN Issues (Amazon S3/Cloudfront)

So I've been meaning to move images and such over to a CDN for my landers and have finally gotten around to it. Am using Amazon S3/Cloudfront and have CNAME'd one of my domains to get cdn.mydomain.com pointing to the cloudfront distribution.

This all works fine. One problem I have though is the images always seem to load faster from my own server than they do from the CDN, always. There is a huge wait/connect time for every image and it's driving me nuts. If I have e.g. jquery on the page coming from their CDN you see it loading in a flash, but my images load balls slow every time on repeated tests. Below is a Pingdom waterfall:



The issue is the same when using the CNAME'd address or directly to the Cloudfront distribution address. I have gone into my bucket/distribution and set the following http headers as I thought they might be the problem:

Cache-control: public, max-age=2678400
Expires: Thu, 01 Dec 2024 16:00:00 GMT

No luck. Anyone had to deal with this before and know how to address it?


03-04-2013 12:54 AM #2 thedudeabides (Moderator)

I tried out Amazon cloudfront also and experienced similarly disappointing results. Even Cloudflare is faster, which surprised me because its main purpose is not a CDN.

You probably already know this but, use google libraries to host your jquery stuff - it's lightning fast.


03-04-2013 12:58 AM #3 pain2k (Veteran Member)

MaxCDN like a boss son.

//nuff said.


03-04-2013 02:42 AM #4 zeno (Administrator)

Quote Originally Posted by thedudeabides View Post
I tried out Amazon cloudfront also and experienced similarly disappointing results. Even Cloudflare is faster, which surprised me because its main purpose is not a CDN.

You probably already know this but, use google libraries to host your jquery stuff - it's lightning fast.
Yeah my jquery stuff was loading from the jquery cdn which was goin just as quick as googles. This S3 issue just pisses me off though... seriously it should be upload > put in webpage > nothing more needed for it to load FAST. Anyone have experience with BH's CDN as well? I'm not at all attached to Amazon, they were just cheap. I find their system overly convoluted.


03-04-2013 11:35 AM #5 nusolutionz (Veteran Member)

check out the rackspace cdn (cloud files)..they are connected to akamais cdn and performance is top notch


03-04-2013 12:01 PM #6 matthewk (Member)

Rackspace is good, they dont offer origin pull which is a pain but if you can put up with that then its good.


03-04-2013 12:35 PM #7 caurmen (Administrator)

I'm going to echo everyone else on this one - I'd try a different host than Amazon for your CDN. It looks like they're giving you about a 400ms download time for your images, which is about what I'd expect (from, admittedly, limited testing) from a CDN that's targeted at mainstream web/webapp use rather than balls-out speed.

The other option - and one I'm increasingly leaning toward for my own projects - is to use a VPS in your target country with Nginx installed to serve your static files. That's INSANELY fast, and very simple. It's a bit more expensive than an all-in-one CDN solution, though.

(BTW, I've been doing some testing of Google App Engine as an alternative free "CDN" option. I'll post my results in a week or so - it's an interesting option, although I'm starting to believe that you need to learn at least a bit of Go to get the best out of it.)


05-14-2013 04:21 PM #8 nefig (Member)

Quote Originally Posted by caurmen View Post
The other option - and one I'm increasingly leaning toward for my own projects - is to use a VPN in your target country with Nginx installed to serve your static files. That's INSANELY fast, and very simple. It's a bit more expensive than an all-in-one CDN solution, though.
Caurmen, could you elaborate on this a lil more please? I understand the Nginx part but what's VPN to do with this? How does it work exactly? (lets say Im running dick pills on Uganda featurephone traffic..)


05-14-2013 04:37 PM #9 cent01 (Member)

GO TO Akamai.


05-14-2013 06:03 PM #10 rafael (Member)

Quote Originally Posted by nefig View Post
Caurmen, could you elaborate on this a lil more please? I understand the Nginx part but what's VPN to do with this? How does it work exactly? (lets say Im running dick pills on Uganda featurephone traffic..)
I think caurmen meant a VPS in the country where you are running your campaigns. So you get a Uganda VPS. And run your dickpills LP there.


05-15-2013 10:32 AM #11 caurmen (Administrator)

Yup, d'oh. I meant VPS, not VPN. A VPN in your target country won't help much

Having said that, I have a case study on this coming up today or tomorrow, with what look to be some pretty surprising results - watch this space.


05-15-2013 10:34 AM #12 cpacharger (Member)

I use Rackspace for all my campaigns. Couldn't be happier


Home > Programming, Servers & Scripts >