Mobile app version of vmapp.org
Login or Join
Courtney195

: How does a CDN like CloudFlare work? What I understand so far: You keep your current web hosting, but you change the DNS servers for your site from the DNS servers of your current hosting

@Courtney195

Posted in: #Cdn #Cloudflare #Post #Proxy

What I understand so far:


You keep your current web hosting, but you change the DNS servers for your site from the DNS servers of your current hosting to CloudFlare's DNS servers.
CloudFlare serves your website's resources from multiple data centers around the world.


Now, I would like to know the technical details of this mechanism. Here are some of the questions I have:


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?
Which site resources are affected? Only static ones? What about the web pages themselves (the HTML documents)? What if the pages are dynamically generated by my server? How does CloudFlare make sure to always serve the most up-to-date version of the page?
What about POST requests to my site (e.g. a visitor uploading data via Ajax which is then stored in the database)? This stuff has to be executed on my server. So, CloudFlare doesn't (and cannot) increase the performance of this process, right? So, CloudFlare just relays the Ajax request to the original web host?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Courtney195

3 Comments

Sorted by latest first Latest Oldest Best

 

@Connie744

To add to Damon's response:

You can find some helpful video tutorials for setting up the most popular/recommended Page Rules with CloudFlare here:

cloudflare.com/features-page-rules

Also, if you have maxed out your available Page Rules on your current plan you will soon be able to purchase additional rules without changing plans.

10% popularity Vote Up Vote Down


 

@LarsenBagley505

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.).

10% popularity Vote Up Vote Down


 

@Steve110

Yes, it's a caching reverse proxy.
"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.
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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme