Questions tagged [varnish]

Varnish is an open source reverse HTTP proxy with extensive caching abilities, i.e. a web accelerator. It is frequently used in front of websites to cache webpages in memory.

This tag is for questions about Varnish Cache. Varnish cache is a reverse http proxy that caches, i.e. a web accelerator. It is open source software used to speed up websites.

2066 questions
14
votes
4 answers

User-friendly error pages from Varnish

We are using Varnish at the front of Plone. In the case Plone goes down or serves an internal error we'd like to show a user-friendly static HTML page which some CSS styling + images. ("The server is being updated page") How to configure Varnish to…
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
14
votes
4 answers

How to clear complete cache in Varnish?

I'm looking for a way to clear the cache for all domains and all URLs in Varnish. Currently, I would need to issue individual commands for each URLs, for example: curl -X PURGE http://example.com/url1 curl -X PURGE http://example.com/url1 curl -X…
laurent
  • 88,262
  • 77
  • 290
  • 428
14
votes
1 answer

What is Pipe mode and pass mode in varnish

what is pipe mode and pass mode in varnish-cache ... I have been trying to refer to this link to understand varnish. I somewhat understand pass but I'd like a better explanation.. http://spin.atomicobject.com/2013/01/16/speed-up-website-varnish/
J-D
  • 737
  • 1
  • 12
  • 27
13
votes
2 answers

Varnish: Guru Meditation

I'm installing Varnish following Varnish 3.0.2 documentation /etc/varnish/default.vcl backend default { .host = "127.0.0.1"; .port = "80"; .connect_timeout = 600s; .first_byte_timeout = 600s; .between_bytes_timeout =…
sparkle
  • 7,530
  • 22
  • 69
  • 131
13
votes
2 answers

Varnish appears to be working but max-age=0

isvarnishworking.com is letting me know that Varnish appears to be responding at that url, but the Cache-Control header's "max-age" value is less than 1, which means that Varnish will never serve content from cache at this url. The max-age…
Toni Michel Caubet
  • 19,333
  • 56
  • 202
  • 378
13
votes
3 answers

Varnish automagically adding load balancer IP to X-Forwarded-For header

My request flow is as follows; HAProxy --> Varnish (4.0.1) --> Apache web backends When a new request comes in to HAProxy, the client's IP address is being added to the X-Forwarded-For header (which is good!). However, it looks like Varnish is…
Benjamin Smith
  • 877
  • 1
  • 9
  • 24
13
votes
3 answers

How do I disable 'Transfer-Encoding: chunked' encoding in Varnish?

Using Varnish 4, I have a set of backends that're responding with a valid Content-Length header and no Transfer-Encoding header. On the first hit from a client, rather than responding to the client with those headers, Varnish is dropping the…
13
votes
1 answer

How to NOT cache 500 Internal Server Errors in Varnish

I can't figure out, for the life of me, how to get varnish to ignore caching of 500 internal server errors. Basically, if someone hits varnish and is returned a 500 internal server error, I want varnish to not cache that page (set a 0s ttl/grace…
Herman
  • 242
  • 1
  • 2
  • 10
12
votes
3 answers

Setting up varnish on same server as webserver

Our company recently decided to start working with the Varnish HTTP accelerator. Most important why we chose this solution was because we are a company that specializes in building web shops (Magento Enterprise) => Magento has a commercial plugin…
Kenny
  • 5,350
  • 7
  • 29
  • 43
12
votes
4 answers

Is Varnishd the right caching solution to use with Rails?

I want to cache full pages on our web application (thousands of pages) that are rendered by the Rails stack, but don't change very often. Each render is quite expensive in terms of resources. My understanding of how Varnishd works is that when an…
Jason
  • 22,645
  • 5
  • 29
  • 51
12
votes
7 answers

Stripping out select querystring attribute/value pairs so varnish will not vary cache by them

My goal is to "whitelist" certain querystring attributes and their values so varnish will not vary cache between the urls. Example: Url 1: http://foo.com/someproduct.html?utm_code=google&type=hello Url 2:…
runamok
  • 920
  • 1
  • 10
  • 24
11
votes
2 answers

Why isn't Varnish sending 304 unmodified when If-Modified-Since header is sent?

When sending a GET request directly to the backend with If-Modified-Since: Wed, 15 Feb 2012 07:25:00 CET set, Apache correctly returns a 304 with no content. When I send the same request through Varnish 3.0.2, it responds with a 200 and resends all…
Nic Cottrell
  • 9,401
  • 7
  • 53
  • 76
11
votes
1 answer

How does varnish deal with dynamic content?

I am studying up on caching and I am looking into varnish for caching. I am wondering though how does varnish deal with dynamically generated content? All over the place people are saying you shouldn't really cache content that might change a lot…
Stephan-v
  • 19,255
  • 31
  • 115
  • 201
11
votes
2 answers

How to set Varnish to run on port 80. Malfunction of DAEMON_OPTS set in /etc/default/varnish

I have installed varnish and fallowed the exact instruction for setting it up, however, it is not working as expected. My /etc/default/varnish setup is: DAEMON_OPTS="-a :80 \ -T localhost:1234 \ -f /etc/varnish/default.vcl…
Lachezar Raychev
  • 2,113
  • 4
  • 24
  • 34
11
votes
4 answers

Varnish Cache log not working

varnishlog is returning: _.vsm: No such file or directory Has anyone else seen this before?
Charlie Davies
  • 1,814
  • 4
  • 29
  • 50