Varnish vs Nginx vs Cloudflare caching. Which is the fastest?

I have Ghost installed on DigitalOcean droplet and it runs nginx/1.18.0 (Ubuntu). I want to increase my page load speed.

Several people on this forum recommended Varnish. I’ve done some research on reverse proxies and decided I’m not going to use it, the reasons are:

  1. The primary reason - Nginx is the fastest for the static content (correct me if I’m wrong).
  2. I have already Nginx installed. Installing and troubleshooting Varnish would take time.
  3. I don’t want any issues with SSL certificates that Cloudflare generates for me.

Unless you can’t provide solid arguments for Varnish, I have ruled it out. I still have caching with Cloudflare where I enabled “Smart Tiered Caching Topology”. It instructs Cloudflare to dynamically identify the optimal upper tier(s) closest to your origin(s), with the objective of minimizing origin resource consumption.

So the question is: Does setting up Nginx caching will get me faster performance if I already have Cloudflare caching?

No. Cloudflare and Nginx would in theory be caching the same content for the same amount of time.

So if Cloudflare sees some content has expired and fetches it again to freshen the cache, it would be a cache miss for Nginx too, and not help performance.

You could do it, but I think it will be splitting hairs.

1 Like