Live data from Hacker News

Varnish 4.0.2 released

varnish-cache.org

11–20 of 56 posts

Re: Varnish 4.0.2 released

#11

We've been long vacillating on using Varnish to power our E-commerce store but from what we've read, Varnish is not a good solution in cases where cookies are part of most of web traffic. Is this true?

You can use Edge Side Includes to get around this. Essentially, you write a page to Varnish containing ESI tags, and it caches that page. The ESI tags, otoh, are parsed every time the page is accessed.

So it's useful if some amount of your content is always the same, with other parts being requested per request (or cached depending on cookies, or whatever else).

Re: Varnish 4.0.2 released

#12
Does anyone have a fairly basic varnish config that deals with a) non-www to www redirects, b) works with https certificates (with the Cloudfare config) , , c) allows CORS for fonts on cloudfront and d) switches off caching for all /admin pages?

Varnish has proven to be very hard to use with nginx in the above setup. Especially, trying to understand the ssl bit is getting to be really hard.

Can it also work with spdy?

Re: Varnish 4.0.2 released

#13

Does anyone have a fairly basic varnish config that deals with a) non-www to www redirects, b) works with https certificates (with the Cloudfare config) , , c) allows CORS for fonts on cloudfront and d) switches off caching for all /admin pages? Varnish has proven to be very hard to use with nginx in the above setup. Especially, trying to understand the ssl bit is getting to be really hard. Can it also work with spdy…

> d) switches off caching for all /admin pages?

Just get your /admin-system to send the correct Cache-Control headers, Varnish will respect the headers, and serve it correctly.

Re: Varnish 4.0.2 released

#14
post #2

> If you are using Varnish Cache for business, consider attending the Varnish Summits If anyone from Varnish AS is reading this (OP?), please consider having a Varnish Summit on the east coast of the US sometime. Soon. Please.

We had one in NYC in May. We might be coming back next year :-)

Re: Varnish 4.0.2 released

#15
Varnish left a sour taste in my mouth. We have used it on one of our high-traffic sites, and had some truly bizarre hard-to-reproduce problems with it.

The major bug it had was that it would work normally for hours, but then it would randomly let the flood of requests through basically killing our servers. It happened over and over and over again. We had multiple talented sysadmins look at it, and none of them could give us any explanation. The only solution was to restart it, and warm the cache all over again. We couldn't figure out what sets it off, it looked just so random.

Re: Varnish 4.0.2 released

#16
post #7
post #2

> If you are using Varnish Cache for business, consider attending the Varnish Summits If anyone from Varnish AS is reading this (OP?), please consider having a Varnish Summit on the east coast of the US sometime. Soon. Please.

Good news, I'm told they are planning an east coast event in the spring.

Thank you very much!

Re: Varnish 4.0.2 released

#17

We've been long vacillating on using Varnish to power our E-commerce store but from what we've read, Varnish is not a good solution in cases where cookies are part of most of web traffic. Is this true?

This is false. Default configuration does not cache any pages with cookies. You can configure varnish to ignore cookies. But as others have stated, Varnish can not magically guess which cookies to ignore and which will modify your content. If your site has /admin, you can tell varnish to not cache that. The cleanest solution is to never ever set any cookies for url-s you want to cache. So if you set a login cookie you set it to /admin.

If you want to know more about it, there is a funny thread about it https://www.varnish-cache.org/lists/pipermail/varnish-misc/2...

Re: Varnish 4.0.2 released

#18

Varnish left a sour taste in my mouth. We have used it on one of our high-traffic sites, and had some truly bizarre hard-to-reproduce problems with it. The major bug it had was that it would work normally for hours, but then it would randomly let the flood of requests through basically killing our servers. It happened over and over and over again. We had multiple talented sysadmins look at it, and none of them could…

That sounds like a "hit-for-pass" scenario: Something from your backend told Varnish "Don't cache this" and varnish stopped doing so.

Re: Varnish 4.0.2 released

#19

We've been long vacillating on using Varnish to power our E-commerce store but from what we've read, Varnish is not a good solution in cases where cookies are part of most of web traffic. Is this true?

This is false. I have personally configured Varnish to power blogs, marketplace websites, and a Magento powered E-commerce store.

If you've worked with Magento then you know it relies heavily on cookies and sessions. Even with all difficulties of modifying Magento I was able configure Magento and Varnish to work together perfectly within a week.

I can point you to the Magento site running with Varnish if you send me an email.

Re: Varnish 4.0.2 released

#20

Does anyone have a fairly basic varnish config that deals with a) non-www to www redirects, b) works with https certificates (with the Cloudfare config) , , c) allows CORS for fonts on cloudfront and d) switches off caching for all /admin pages? Varnish has proven to be very hard to use with nginx in the above setup. Especially, trying to understand the ssl bit is getting to be really hard. Can it also work with spdy…

a) I just let Nginx do the redirect. Varnish can cache 302's so after the first one it won't hit Nginx again until the cache times out.

b) You have to terminate SSL connections before hitting Varnish. There is very little chance SSL termination will ever be part of Varnish. On AWS you can terminate with ELB.

c) Varnish can add HTTP headers and it will respect the headers your backend sets.

d) Varnish can disable caching for a specific path or again it will respect the No-Cache headers a backend sets.

Post reply on HN