CDN with GEOIP and LoadBalancer



We’re having some troubles with images that are not (apparently) shared over CloudFlare’s CDN.
We’re actually having 3 servers (Canada, Europe and Singapour) that are shared with CloudFlare load balancing and GEOIP, to minimize the reponse time for our website. Website is mirrored over our 3 servers.
We’re expecting that all images are shared over the world with CloudFlare’s CDN, however, some images are OK when requesting our Canada server, and the same image requested from our European server we’re getting a 404 error. The image is physically located on the Canadian server, but we’re expecting this image available in the CDN. Is this behaviour normal?
Thanks for any clue.


Why would you get a 404 if you replicate the resources between your servers?


Are you using Cloudflare’s Load Balancer product, or is it your own load balancer?

To add to what @sandro said, I’m curious as to why the image is physically located on the Canadian server and not the Euro server. Is there some special URL for images?

Cloudflare is just going to replicate the user experience, but through a local POP. If your load balancer works properly without Cloudflare, it should be fine with Cloudflare.


Cloudflare is a pull CDN. Each POP maintains its own cache and pulls from the origin server when content is not in cache or needs ot be refreshed. If you are using Argo tiered cache then regional cache servers also come into play, but they also are pull from origin.

If the ‘website’ is mirrored over 3 servers, the ‘content’ should be mirrored over 3 servers. So a European user accessing the content would be directed by your LB to the EU server for content as you’ve direct it to.


@sandro Actually only the application installed on servers is replicated (rsync). Images and other flat files are not.


@sdayman Yes, I’m using Cloudflare’s Load Balancer. To answer your question, images are located in Canada for example when user create a profil on our site, (s)he can upload an image for its avatar. So, because of the Load Balancer, Canadian people (and US) avatars are uploaded on Canadian server. That’s why European people, when they visite this new profile (new registered user from Canadian serveR) do not see avatar (our 404 apache error reported).


Which is the answer as to why it does not work :slight_smile: Please see @cscharff’s response.


@cscharff foolishly I though Cloudflare’s CDNs shared they’re content over the world but it seems it is not the case. So I think I’ll have to periodically rsync images directory content over the 3 web servers in order to get the same content for all our webistes

Thanks to all for you lights

closed #9

This topic was automatically closed after 14 days. New replies are no longer allowed.