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?

2 Answers 2


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.

  • 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. Commented Nov 3, 2012 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. Commented Nov 3, 2012 at 1:02

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.

  • are you sure? reddit still works for visitors when the "servers are down", thus I don't think it's server-side code. Commented Nov 2, 2012 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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