Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I know nothing about CDNs, and tomorrow I'm going to start what promises to be a lengthy investigation of them.

But I wanted to share my ideal vision of a CDN - which basically maps to the concept of a 'paid proxy'.

In a nutshell, I just want to cache all my static files (js, css, images etc) so that users always access a close enough POP.

In my mind it should be very simple to achieve this goal, I just change:

script: src = 'http://abc.com/script.js'
image src = 'http://abc.com/image.jpg'

to:

script: src = 'http://cdn.com?src=abc.com/script.js'
image src = 'http://cdn.com?src=abc.com/image.jpg'

The proxy would query my server exactly once, and then push the content out to the edges. No explicit uploads, no hassle, no APIs etc.

Am I dreaming or is this achievable?

Thanks.

share|improve this question
    
So something like nyud.net then? Rather than passing the original url to the cdn as a parameter it modified the hostname. Eg. google.com.nyud.net/search?q=foo –  kaerast Aug 5 '10 at 12:51

3 Answers 3

up vote 4 down vote accepted

That is exactly what they call an origin pull CDN. These proxies will typically hold the content for a limited time duration and refresh it when requested. There are other kinds of CDN, those which allow you to upload the content directly to them as well.

share|improve this answer
    
My ideal is slightly different to how normal (open) proxy caching works, because I refer to the CDN network directly in the URL. What I'm basically saying is that the whole uploading/hosting part of the service offered by CDNs could be conveyed implicitly in the url. I'll look into origin pull CDNS. Thanks very much! –  David Semeria Aug 5 '10 at 8:19
    
People prefer to be able to use their own subdomain such as cdn.example.com instead of using xcdnservice.com/example.com/file.jpg. –  gekkz Aug 5 '10 at 11:16
    
Thanks gekkz, I started to notice that after reading more on the topic –  David Semeria Aug 5 '10 at 18:28

The technique you describe works and is available on serveral providers.

Some points to think about during your investigation:

  • invalidation: either based on the headers your source sets, or on preconfigured rules, or on explicit calls you make to the cdn
  • replication of headers to your clients, so you can also influence their caching policy
  • ESI, a lot like SSI
  • Delivery performance and guarantees on that - some CDN's are focussed on a specific continent; if a part of your audience is elswhere they're not going to see fantastic low latency serving. It's not wrong to ask.
  • Price, cdn's list prices are outrageous. You should (depending on your features and traffic) allways negotiate the price down quite a bit.

Also, often a reason to deploy a cdn is to be able to handle a burst of traffic. Make sure your contracts reflect that.

Send me a message if you need more input on how to select and integrate a cdn or scaling in general

share|improve this answer
    
Thanks Joris, very kind. I don't have enough reputation (yet) to vote you up.. –  David Semeria Aug 5 '10 at 12:04

Kind of sounds like an extension of Amazon's cloud. For example all static content on woot is served by Amazon. Could be achieved by mounting the static content root directory to dump files into the cloud through ftp for example.

edit: sorry missed the ?=host/resource part.

share|improve this answer
    
No problem! See my reply to sybreon above - I basically want to avoid the whole upload phase by specifying both the CDN and the real origin in the same url –  David Semeria Aug 5 '10 at 8:22
    
Almost all CDNs have a proxy offering (they call it "origin pull" in the CDN industry). SimpleCDN & MaxCDN will let you set this up online with just a credit card (free trials too I think). –  rmalayter Sep 21 '10 at 17:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.