Varnish Dynamic Page Caching & Cache Purging vs Nginx+Redis

Guillaume Quintard guillaume at varnish-software.com
Tue Jul 27 14:42:33 UTC 2021


Hi,

That's a very broad question, and so I'll keep the answer pretty high-level.

All in all, Varnish has a lot fewer internal rules than nginx and really
only cares about requests at an HTTP level. This means "dynamic" content
doesn't matter to Varnish, it's just requests/objects with specific
headers, querystrings, etc. As a result, I feel that Varnish is way better
equipped to functionally handle any kind of traffic.

Of course, because Varnish operates at a lower level, with fewer rules, it
needs an excellent configuration scheme, and that's probably what trips
people: the configuration language is actually a programming language that
allows you to dictate very precisely how each request is handled. Here an
article I wrote some weeks ago about this:
https://info.varnish-software.com/blog/finally-understanding-built-in-vcl

For purging, I won't mince my words: nginx is bad and you should stay away
from it, it's limited and impractical. Varnish on the other side is once
again very low-level and will force you to implement your own logic, but
the primitives are much more powerful. And, lucky you, here's a ready-made
VCL framework you can use:
https://github.com/varnish/toolbox/tree/master/vcls/invalidate

Hope this helps

Cheers,
-- 
Guillaume Quintard


On Tue, Jul 27, 2021 at 3:17 AM s s <mailme.s at yandex.com> wrote:

> Hello all,
>    I am quite new to Varnish.  I have been reading about both Varnish and
> Nginx+Redis for page caching, and I am particularly interested in dynamic
> caching and cache purging.  I have read in a number of posts that Varnish
> is "more flexible" in this regard, but without many additional details on
> this.  Can you please explain what features Varnish provides for dynamic
> page caching and cache purging, especially which are not available (or are
> more limited) in Nginx+Redis?  Please forgive me if my question is very
> basic/ignorant.  As I said, I am new to Varnish.
>
> Thanks and Best Regards,
> Sal
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20210727/f069328e/attachment-0001.html>


More information about the varnish-misc mailing list