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
117
votes
2 answers

Memcache(d) vs. Varnish for speeding up 3 tier web architecture

I'm trying to speed up my benchmark (3 tier web architecture), and I have some general questions related to Memcache(d) and Varnish. What is the difference? It seems to me that Varnish is behind the web server, caching web pages and doesn't require…
user449219
  • 1,333
  • 2
  • 9
  • 7
52
votes
1 answer

What does Varnish hit-for-pass mean?

Varnish Version 3 has some objects for different operations. For example, pass is used when it has to retrieve data from backend, and it uses hit when it finds requesting content in cache. But I cant understand usage of hit-for-pass. When does…
Muneeb Nasir
  • 2,414
  • 4
  • 31
  • 54
51
votes
4 answers

Configure multiple sites with Varnish

We have a server which needs to serve multiple domains though varnish e.g. example1.com, example2.com and example3.com Our current .vcl file looks like this: sub vcl_recv { set req.http.Host = "example1.com"; lookup; } How do I set the…
Tom
  • 33,626
  • 31
  • 85
  • 109
45
votes
4 answers

Haproxy in front of varnish or the other way round?

I can imagine two setups: Load-balance then cache +-- Cache server #1 (varnish) -- App server #1 / Load Balancer (haproxy)-+---- Cache server #2 (varnish) -- App server #2 …
MiniQuark
  • 46,633
  • 36
  • 147
  • 183
44
votes
11 answers

Tux, Varnish or Squid?

We need a web content accelerator for static images to sit in front of our Apache web front end servers Our previous hosting partner used Tux with great success and I like the fact it's part of Red Hat Linux which we're using, but its last update…
Polsonby
  • 22,825
  • 19
  • 59
  • 74
31
votes
2 answers

How to properly set up Varnish for Symfony2 sites?

I have a website (with ESI) that uses Symfony2 reverse proxy for caching. Average response is around 100ms. I tried to install Varnish on server to try it out. I followed guide from Symfony cookbook step by step, deleted everything in cache folder,…
Ondrej Slinták
  • 31,386
  • 20
  • 94
  • 126
30
votes
2 answers

How do you choose between Memcached, Redis and Varnish?

I am really very confused about Memcached, Redis and Varnish. I know they are used for caching, but I don't know how much they help, and how you know which one to use. And lastly, I would like know what you would use for a site with user-uploaded…
Robin
  • 5,366
  • 17
  • 57
  • 87
27
votes
5 answers

Best way to cache RESTful API results of GET calls

I'm thinking about the best way to create a cache layer in front or as first layer for GET requests to my RESTful API (written in Ruby). Not every request can be cached, because even for some GET requests the API has to validate the requesting user…
maddin2code
  • 1,334
  • 1
  • 14
  • 16
25
votes
1 answer

Flask 301 Response

My flask app is doing a 301 redirect for one of the urls. The traceback in New Relic is: Traceback (most recent call last): File "/var/www/app/env/local/lib/python2.7/site-packages/flask/app.py", line 1358, in full_dispatch_request rv =…
Nalum
  • 4,143
  • 5
  • 38
  • 55
24
votes
1 answer

Howto control Varnish and a Browser using Cache-Control: max-age Header in a Rails environment?

Recently I added a Varnish instance to a Rails application stack. Varnish in it's default configuration can be convinced from caching a certain resource using the Cache-Control Header like so: Cache-Control: max-age=86400, public=true I achieved…
GeorgieF
  • 2,687
  • 5
  • 29
  • 43
23
votes
4 answers

How to send a purge request in varnish

I can't see a similar question, but apologies if I'm duping. We're running a varnish cache on our system, but want to install a system where we can purge individual pages when they are edited (fairly normal). We've been trying to get it to work by…
flukeflume
  • 707
  • 1
  • 6
  • 14
23
votes
3 answers

How do I set HTTP Headers in Ruby/Sinatra app, hosted on Heroku?

I've got a working app based in Ruby and Sinatra that is deployed on Heroku. I want to take advantage of the HTTP caching available on Heroku, which uses Varnish. I'm not sure what the best way to set the headers is, and the correct syntax. Any…
Neil
  • 297
  • 1
  • 2
  • 5
22
votes
2 answers

How to debug VCL in varnish?

How can I print a log in VCL? Can I print log info on screen? Can I do like this? sub vcl_recv { .... log.info(req.http.host); // can i write a log here? .... }
lichengwu
  • 4,277
  • 6
  • 29
  • 42
21
votes
4 answers

Disadvantages to rack-cache vs. Varnish in Heroku cedar stack?

The previous 2 Heroku application stacks came with a Varnish layer which automatically reverse-proxy-cached content based on http headers. The new Heroku cedar stack doesn't have this Varnish layer. Heroku suggests using rack-cache and memcache…
John Bachir
  • 22,495
  • 29
  • 154
  • 227
20
votes
4 answers

Error 503 Backend fetch failed

I have this error in my site Error 503 Backend fetch failed Backend fetch failed Guru Meditation: XID: 526707 Varnish cache server Anyone know what may be the cause or how to find out what happens?
1
2 3
99 100