Questions tagged [varnish]

Varnish is a high-performance reverse proxy and load-balancer package for Linux/Unix systems.

Varnish is primarily a caching reverse proxy, but also exhibits load-balancing and backend checking mechanisms and is very widely used on high traffic websites.

Varnish was designed from the ground to be a high performance reverse caching proxy and to not compete with the operating system on managing resources like memory. Most recent versions of Varnish support storing cache on memory or disk, and serving old content in case of backend fail (saint mode), among other features.

Varnish is written by Poul-Henning Kamp (PHK), and his Architect Notes are available about varnish design. PHK is also a well known FreeBSD kernel developer and mantainer.

937 questions
3
votes
2 answers

Varnish - Cookie

I have the following situation: On my site, javascript sets a cookie that contains relevant information for generating the markup. I therefore want Varnish to cache each page separately for each value of said cookie. All the documentation I have…
theduke
  • 600
  • 2
  • 6
  • 12
3
votes
1 answer

How can I log timestamps with Varnish health probes?

I'm using Varnish 3.0.3 on RHEL 6 as a caching load balancer in front of several Apache web servers and want to keep a log of when Varnish sees the back-ends change from healthy to sick and back again. From the command line I can run varnishlog -O…
Adam Franco
  • 261
  • 2
  • 9
3
votes
1 answer

Using a 3rd server for caching database and static content

So, I just "won" a free year for a basic VPS with 5GB storage and 256MB ram and I thought that the best thing I could do with it is to separate the memcache service from each of my other 2 servers and maybe implement an NGINX Proxy or Varnish (or…
w0rldart
  • 217
  • 1
  • 2
  • 14
3
votes
1 answer

varnish delete least requested files

I see that varnish can be configured to set -smalloc or -sfile with a certain size. I want to set a file cache of 1G such that least requested files are deleted first when cache is full. Is this possible in varnish? Is there another reverse proxy…
nurettin
  • 378
  • 2
  • 10
3
votes
1 answer

Varnish, outputting ReqEnd using standard out

Is it possible to output ReqEnd using std.log in VCL? I would like to use ReqEnd in varnishncsa logging.
Justin Hourigan
  • 345
  • 1
  • 9
3
votes
1 answer

Logging the client IP with Nginx/Varnish/Apache

I have Nginx listening on port 443 as an SSL terminator, and proxying unencrypted traffic to Varnish on the same server. Varnish 3 is handling this traffic, and traffic coming in directly on port 80. All traffic is passed, unencrypted, to Apache…
jetboy
  • 912
  • 2
  • 11
  • 25
3
votes
1 answer

Can Varnish/Nginx cache and store PHP pages after user visited?

Please assume that there is a PHP CMS that retrieves content according to IDs from database. So every time you visit this website it interacts with Database and Processes the PHP request. Can Nginx or Varnish cache and store a page after user…
Zim3r
  • 1,454
  • 5
  • 24
  • 45
3
votes
2 answers

Varnish VCL - Regular Expression Evaluation

I have been struggling for the past few days with this problem: Basically, I want to send to a client browser a cookie of the form foo[sha1oftheurl]=[randomvalue] if and only if the cookie has not already been set. e.g. If a client browser requests…
liquidity
  • 418
  • 1
  • 7
  • 22
3
votes
1 answer

Using Varnish as load balancer

Varnish already support load balancing HTTP 1.1 and Web Socket requests, e.g. https://www.varnish-cache.org/trac/wiki/LoadBalancing Since we already using Varnish for caching purpose, are there any benefit if we add nginx or ha proxy in front of…
Ryan
  • 5,831
  • 24
  • 72
  • 91
3
votes
3 answers

Load Balancer --> Varnish --> Nginx

Been scratching my head for a few hours now and wanted to see if anyone can help. 1) I have a load balancer with 6 servers in the back end. 2) The back end servers are Nginx and to get the real IP addresses of the visitors, all I have to do is the…
ddavtian
  • 161
  • 2
  • 7
3
votes
1 answer

nginx and varnish for caching forcing ssl

I'm in the process of doing my homework for a move from apache w/o caching to nginx with caching, possibly via varnish... After reading various blogs, articles, serverfault questions, etc. I understand that varnish cannot work with ssl, and that…
davidkomer
  • 165
  • 6
3
votes
2 answers

Varnish: Sending "If-None-Match"-Header to Backends?

I'd like to use etag caching directly in my application / verify the eTag in my Application. How is it possible to route the "If-None-Match" header to the backends? It seems that Varnish is cutting out this header by default.
Tobias
  • 161
  • 1
  • 6
3
votes
1 answer

How to you properly invalidate the local cache on a browser?

I'm troubleshooting a problem on my site where a user will authenticate successfully but the browser will load (I believe) the local cache of the page to which the user is redirected. Since it's a local cache, the page appears as if they aren't…
Justin
  • 915
  • 3
  • 13
  • 26
3
votes
1 answer

Syntax for piping varnish logs to rotatelogs

Ubuntu 12.04 Server x64, Varnish 3.0.2 I'm trying to pipe varnishncsa's logs through Apache's rotatelogs, and running from the shell, things work fine: sudo varnishncsa -a -P /var/run/varnishncsa/varnishncsa.pid |/usr/sbin/rotatelogs…
jetboy
  • 912
  • 2
  • 11
  • 25
3
votes
1 answer

Varnish purge on POST or PUT

In my application stack, I'm using CouchDB (in this scenario, to all intents and purposes it's a simple REST server) and I want to put Varnish in front of it to alleviate read load. I know that whenever my application updates a document through…
Martin
  • 55
  • 9