MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
WebPagetest Forums - Is it possible to run ENTIRE site (not just images, etc) via CDN?

WebPagetest Forums

Full Version: Is it possible to run ENTIRE site (not just images, etc) via CDN?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
Cool. I had forgotten about the impact of DNS though your original DNS must have been pretty bad (with no caching). CDN's do usually have a pretty good DNS infrastructure so it makes sense.
I've just completed more tests. In locations close to the origin server (east cost), the improvement of load time seems to average 50 - 100 ms. In the rest of the world (west coast included), it's about 100 - 200 ms, more in some cases.

I'm quite happy! :-)

Pat, I'm actually using Dnsmadeeasy, and I'm not sure why occasionally the DNS look up times have been so slow.
How did you do:

Was that something that you manually did or something automatic that's been done? Our site is an ecommerce site and every page has 50 product thumbnails by default (can go up to 500 if the user chooses to). I'd like to do spriting like you have there, except for we have a dedicated in-house photography studio that does hundreds of new photos a day. So such a solution would have to be automatic, not just because of the amount of new images, but the scope of our catalog as well (over 20,000 sku's). If your solution isn't automatic, have any ideas?

p.s. Congratulations, i'm quite impressed with the speed of your site.

p.s.2. Would like to clarify that we currently do use spriting, just not on the product thumbnail level. Since the majority of our http requests are from those though, that is probably the next best place for me to focus my attention.
Thanks, Jarrod. Unfortunately it was done manually. It's a good enough solution for my site, but obviously not a solution for your site. My site talks about a limited number of software products, so the pictures are in most cases good for next year, too. Just the version number in the description changes, plus the review is updated.
@jarrod, you might be a lot better off using data URI's for the browsers that support it (chrome, safari, IE8+, Firefox) instead of trying to sprite the images independently. You can inject them directly from javascript and have a service that returns a dynamic set of them (so it is cacheable) as gzipped json which makes it easy to make it cacheable and combine several together.
That sounds good, any tutorials or information on doing that? Thanks!
Not that I'm aware of. Looks like Google Image Search uses a similar technique. Regardless of how you go about it, there is going to have to be some trade-offs for cacheability (when you combine multiple files together then it's that specific combination that you are caching). For category pages this shouldn't be a problem but there's probably a long tail of images for search.

Hand-waving the caching issue for now, the flow would basically look like this:

- detect that the browser can support data URI's (on the server probably)
- instead of src tags on the images, put an id on the img tag (or a div where the image will be placed inside of)
- below all of the images on the dom, include javascript that walks all of the tags and makes requests to the back-end image/json service for the images in groups (say 6-10 per request)
- when the json response for each comes back, dynamically insert the src tag on the image elements with the data URI for the image

For images that you don't expect to be cached you can actually inject the data URI directly into the response (either inline in the img tag or in javascript at the end of the page).
A few hours ago, I took this CDN thing one step further. I decided to let the CDN cache even html for guests (my members are still able to see un-cached version of the forum.)

Now the load time seems to be more consistent across the globe:

- Dulles, VA 0.385 s
- Los Angeles, CA 0.585 s
- Frankfurt, DE 0.530 s
- Paris, FR 0.363 s
- São Paulo, Brasil 0.897 s
- Wellington, New Zealand 0.632 s
- Sydney, AU 0.378 s

Now the "worst" performing thing is the DNS. Sometimes the first test shows the DNS time multiple times longer than the subsequent tests. But there's very little I can do about it short of looking for a different CDN provider. My CDN provider keeps the TTL time very short, I don't remember now exactly what it is, but if I recall right, the last time I checked it was like 20 minutes or something. I'm not sure if that's typical of CDNs to keep it this short.
Typical CDN's actually keep the TTL at 60 seconds so you're actually in better shape than most :-)
I may be remembering it incorrectly. The TTL may be much shorter. It's a bit disappointing, but I don't thing there is anything I can do about it at all :-(

By the way, Patric, any idea why some test locations give me F and others A for "Cache Static Content"? The headers are identical. Huh
Pages: 1 2 3 4 5 6 7
Reference URL's