How does a CDN like CloudFlare work?

  1. Yes, it's a caching reverse proxy.
  2. "It depends". By default only things like images and CSS are cached, but you can set the cache level per zone and set Page Rules to override what is cached or should not be cached. Static HTML can be forced to be cached by a page rule, but dynamic content obviously cannot. The exception here is if you have the Business or Enterprise plan, or sign up through certain hosting partners, where you gain access to the Railgun technology whereby CloudFlare will only fetch the information that has changed on a page, even if it is dynamic. If you've set CloudFlare to cache everything, you need to control cache timeout either with cache headers on the origin and/or setting the cache TTL on your zone in the CloudFlare UI.
  3. POSTs must always be sent to the origin, so CloudFlare just passes them straight through. You should still get an increase in performance because CloudFlare uses anycast to serve DNS and HTTP from the closest data centre.

Full disclosure: I work for CloudFlare.


Just to add a little more clarity:

There's a pretty good article on Quora about how CloudFlare works.

Which site resources are affected? Only static ones? What CloudFlare caches by default.

"Does CloudFlare act as a cache proxy? Say, I have a bunch of images on the pages of my site. Does CloudFlare cache all those images on each of their data centers and then serve them from those data centers?"

You can extend our caching beyond static content with PageRules.

Note: We will not cache third-party resources that are on your site (Flickr, Google, Facebook, etc.).