4 ms·
Thankfully, this treats the subject of revalidation, as opposed to simple caching setups/write-ups which merely set expiry periods for cached resources. Varnish
by tannhaeuser 10y ago
Thankfully, this treats the subject of revalidation, as opposed to simple caching setups/write-ups which merely set expiry periods for cached resources. Varnish (considered otherwise a competent cache) didn't handle it at all before V4.
[1]: http://stackoverflow.com/questions/34938706/varnish-4-does-not-honor-cache-control-must-revalidate http://stackoverflow.com/questions/34938706/varnish-4-does-n...
- tyingq 10y agoThe bigger problem with varnish, to me, is that it doesn't support TLS. So you end up fronting it, with say nginx...which also has a reasonable cache, so why bother? Edit: Should mention that varnish is a nice piece of software...not bashing. It's just that most people would prefer less pieces in their overall solution.
- tannhaeuser 10y agoAnd no support for HTTP/2 until recently. They're suggesting Hitch for SSL termination now. [1]: https://info.varnish-software.com/blog/varnish-cache-5-http2-support https://info.varnish-software.com/blog/varnish-cache-5-http2... Edit: Apache also has caching/does it all in one package; they're even contemplating a module for certbot (in addition to or as replacement for the official certbot/letsencrypt Python package for Apache)
- porker 10y agoIs 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.
- simonw 10y agoThe varnish docs have a couple of philosophical essays on why they don't support SSL: https://www.varnish-cache.org/docs/trunk/phk/ssl.html https://www.varnish-cache.org/docs/trunk/phk/ssl.html https://www.varnish-cache.org/docs/trunk/phk/ssl_again.html https://www.varnish-cache.org/docs/trunk/phk/ssl_again.html I think they are well justified in enforcing the separation of SSL code from caching memory management.