4 ms·
can you explain a bit about caching of the static items around the globe? So a user in France tries to hit my site they get to CloudFlare. CloudFlare says her
by jason_slack 15y ago
can you explain a bit about caching of the static items around the globe?
So a user in France tries to hit my site they get to CloudFlare.
CloudFlare says here is part of the site to serve.
The dynamic elements then get passed through to my server for what needs to be displayed.
So do they then have a virtual host type setup for my domain (and all of their customers) so they then answer on it and run something like Varnish Cache?
- paulsutter 15y agoThe way it probably works is that they have servers around the world, and either use a geographic DNS or IP anycast. So the user in France contacts their nearest server and requsts the url for the resource. If the file has already been cached there at that server, they serve it. Otherwise, that server requests it from your origin server, and serves it that end user in France. They wouldnt set up any specific virtual host for you. They just have an http server that receives all the requests, and dispatches internally based on the domain name in the url. I get the impression that I'm going into more detail than you want. What is it that you're concerned about?
- jason_slack 15y agoNo this is the details I really want. I really like to understand technically what is going on before I use a service. So far Cloud Flare has not returned my requests for a "Sales" talk. I am just not going to turn over my NPO stuff to them without understanding! Can you explain how they would dispatch the traffic internally without a Virtual host? a rewrite rule, perhaps? How do they get my static content? Do they just wget or curl it? Do I provide it? I assume it has expiration so if I change my CSS users dont get served the old stuff for very long? We could e-mail privately if you dont mind too. My e-mail is in my profile.
- paulsutter 15y agoI suggest learning about HTTP and DNS first. The easiest starting point might be to install firebug so that you can see what's really happening between a browser and a web server. In short, when the server receives the raw request, the targeted domain name and path are included in the headers. With that raw request its pretty easy to do whatever they need. Honestly, I dont really know what virtual hosts or rewrite rules are. These sound like specific features of web frameworks rather than anything inherent about the internet. Feel free to ask me questions by email. Also don't be afraid to say if you want to implement something similar. It isn't hard to do.