3 ms·
Is nginx as a reverse proxy as efficient at caching as varnish? Asking as I haven't found any benchmarks on the subject. I'm using varnish via Fastly, and have
by porker 10y ago
Is nginx as a reverse proxy as efficient at caching as varnish? Asking as I haven't found any benchmarks on the subject.
I'm using varnish via Fastly, and have come to greatly appreciate the fast cache-clear, so we can push all content out into the cache, not just static assets.
- cknight 10y agoI believe NGINX's caching is as efficient, if not moreso, but it is less flexible. The tools available to you in Varnish's VCL are substantial, plus you get ESI support - something NGINX lacks.
- detaro 10y agoAlso selective cache purging is a paid feature with nginx.
- tyingq 10y agoIf you're using the filesystem backed cache with nginx, selective cache purge, stats, etc, is a fairly trivial scripting task.
- unsignedinteger 10y agoAgreed, There is also an OS alternative which essentially mirrors the functionality of propriety nginx cache purge: https://github.com/FRiCKLE/ngx_cache_purge https://github.com/FRiCKLE/ngx_cache_purge Hence you can just build it with your standing nginx binary reducing the need for miscellaneous scripts.
- detaro 10y agothanks for the info/link!
- tyingq 10y agoI doubt there's a notable performance difference, and it's a bit of apples and oranges unless you front varnish with something that does SSL for your benchmark. Not many use cases for plain http caching anymore. Varnish does likely have an edge with flexibility and expressiveness around configuration, since it's a single purpose tool.