tim peterson
tim peterson

Reputation: 24305

Amazon Cloudfront slower for delivering assets than serving them directly from EC2?

I've noticed that on mobile Safari, when I deliver my assets via Cloudfront they load noticeably slower than if my assets are served just from my EC2.

Specifically, my site has a main background image that appears noticeably slower than the text delivered by EC2. The loading of this background image doesn't noticeably lag behind the text on Chrome on my laptop presumably b/c of the greater performance of Chrome vs. mobile Safari.

I'm at a loss about what to do about this since the whole point of Cloudfront is to serve assets fast and take load of my EC2 but the delay in this background image appearing makes for quite an ugly, i.e., unacceptably bad, UX.

NOTE: Please don't reflexively vote to migrate this question to another SE site as the whole point is that it is not clear what approach would be best.

Upvotes: 1

Views: 1524

Answers (1)

janiake
janiake

Reputation: 45

We've done some comparative tests and it seems that the advantage of using cloudfront depends on the size of the requested file. For a small file (2kb) CF response time is greater than requesting directly to EC2. For a 15kb file the response time is almost the same. For a 57kb file (jquery-1.3.2.min.js), cloudfront was 4x to 5x faster than EC2.

Upvotes: 3

Related Questions