4 ms·
A practical guide to varnish
- CWIZO 16y agoI've first heard of Varnish today, so it's quite a coincidence that this poped-up today here ... But I'm a little bit confused. If I used this for CSS, is it really more efficient to serve them trough Varnish than to serve them from my server (nginx) which is configured to send the appropriate cache headers? I always set my css to expire far far in the future (expires max;), and I invalidate the cache by changing a GET parameter for the CSS file that has changed (somefile.css?v=X). I'll have to read more about this, especially the stuff about dynamic content.
- ericmoritz 16y agoIf I remember correctly, Varnish by default will use the standard HTTP headers to cache the content. This is my preferred way "configuring" Varnish. I like letting the app decide how to cache it's content rather than putting a bunch of special rules in VCL. Some people strip out the cache headers once it hits Varnish, but I prefer to let the user agents cache the resources locally and use Varnish as a stop-gap for the misbehaving user agents. As with everything, YMMV