Current time: 04-17-2014, 04:41 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 2 Votes - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it possible to run ENTIRE site (not just images, etc) via CDN?
09-13-2011, 09:02 PM
Post: #11
RE: Is it possible to run ENTIRE site (not just images, etc) via CDN?
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
09-13-2011, 10:40 PM
Post: #12
RE: Is it possible to run ENTIRE site (not just images, etc) via CDN?
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.

Marvin
Find all posts by this user
Quote this message in a reply
09-13-2011, 11:01 PM (This post was last modified: 09-13-2011 11:03 PM by jarrod1937.)
Post: #13
RE: Is it possible to run ENTIRE site (not just images, etc) via CDN?
How did you do:
http://www.laptopgpsworld.com/images/upl...100922.png

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.
Find all posts by this user
Quote this message in a reply
09-13-2011, 11:55 PM (This post was last modified: 09-13-2011 11:55 PM by Marvin.)
Post: #14
RE: Is it possible to run ENTIRE site (not just images, etc) via CDN?
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.

Marvin
Find all posts by this user
Quote this message in a reply
09-14-2011, 12:10 AM
Post: #15
RE: Is it possible to run ENTIRE site (not just images, etc) via CDN?
@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.
Visit this user's website Find all posts by this user
Quote this message in a reply
09-14-2011, 12:35 AM
Post: #16
RE: Is it possible to run ENTIRE site (not just images, etc) via CDN?
That sounds good, any tutorials or information on doing that? Thanks!
Find all posts by this user
Quote this message in a reply
09-14-2011, 12:56 AM
Post: #17
RE: Is it possible to run ENTIRE site (not just images, etc) via CDN?
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).
Visit this user's website Find all posts by this user
Quote this message in a reply
01-20-2012, 09:15 AM
Post: #18
RE: Is it possible to run ENTIRE site (not just images, etc) via CDN?
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.

Marvin
Find all posts by this user
Quote this message in a reply
01-20-2012, 09:41 AM
Post: #19
RE: Is it possible to run ENTIRE site (not just images, etc) via CDN?
Typical CDN's actually keep the TTL at 60 seconds so you're actually in better shape than most :-)
Visit this user's website Find all posts by this user
Quote this message in a reply
01-20-2012, 10:16 AM (This post was last modified: 01-20-2012 10:17 AM by Marvin.)
Post: #20
RE: Is it possible to run ENTIRE site (not just images, etc) via CDN?
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

Marvin
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)