I have a website with nearly 99% of the content served from a Nginx cache (which is also the web server). To give you an idea around how simple the caching mechanism is, this is my cache key

proxy_cache_key "$scheme://$host$uri"; 

I am implementing failover web server/cache using Cloudflare load balancing. One more web server in front of the origin web server. If the cache is a MISS or BYPASS, the request goes from the cache web server to the origin and refreshes both the machines. To warm up the redundant cache machine I copy/rsync over the cache files (once).

Here’s the tricky part: The Cloudflare load balancer is round robin and has geographical affinity. Which means that if the request were to hit the origin directly and it’s a MISS the cache won’t be replicated.

I thought of running unison on cron but that seems very ducktape.

What’s the right approach I can follow here?


why not use lsyncd? if file synchronization is the only concern? its a fairly simple and sustainable tool

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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