Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm not sure what this is called. For example, if you're logged out of Reddit, you see a cached, static version of the site from the CDN. When you're logged in, you don't hit the CDN and instead directly to Reddit's servers.

What is this called? Which CDNs provide this service?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Let's skip the CDN term as it's not giving us architectural view of the solution.

The way it's done is though the use of series of caching servers that behave like reverse proxies. The best example is Varnish. Once you set the session id cookie, use of Varnish cache is dismissed. Otherwise, you're served with a response without even application server being hit.

share|improve this answer
    
i think this is what i'm looking for. can this be done using amazon's elastic load balancer? i think using varnish and ELB is overkill. –  Jonathan Ong Nov 3 '12 at 0:47
    
Even though ELB is a reverse proxy too, it's not capable of caching your content. Here is the complex scenario: 1.bp.blogspot.com/-P6CC37dvDyM/T2YDprvtBBI/AAAAAAAAAYg/… . Cut what you don't need and replace HAProxy with ELB. –  ABerezovskiy Nov 3 '12 at 1:02
add comment

It's just server side code that checks to see if you're logged in. If you are, it makes an API call. If you aren't, it finds the latest cache on the CDN and shows that.

I'm not sure if any CDNs specifically mention that use case. Reddit's servers are just uploading a static file to the CDN and replacing it when it goes stale. It makes a big difference for a site like Reddit, but only because they have such a massive number of visitors & pageviews, but only a small percentage of them are users. Many websites would see only negligible gains from it.

share|improve this answer
    
are you sure? reddit still works for visitors when the "servers are down", thus I don't think it's server-side code. –  Jonathan Ong Nov 2 '12 at 23:41
add comment

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.