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
9
votes
3 answers

Debug Varnish HTTP Purge

One of the Wordpress blogs I'm giving maintenance is not purging the cache using the plugin Varnish HTTP Purge. Whether using Varnish Cache Purge button or when we edit a post. In order to know the cause of the problem, I would like to know a way to…
9
votes
1 answer

Are ESI blocking or non-blocking?

I'm planning my caching strategy and I'm digging into ESI to see if it fits my needs. Today these questions arose: Is each include executed in serial or parallel? Say I have 5 of these: {% render '...' with {}, {'standalone': true} %}. I understand…
ChocoDeveloper
  • 14,160
  • 26
  • 79
  • 117
8
votes
1 answer

How do you set a cookie from within an ESI:include script?

I have a basic PHP page being loaded through Varnish with a single ESI include that calls back to the server to set a cookie. The cookie is set with domain access and the like, but when called through ESI the cookie is never set. If you access the…
Mike Flynn
  • 2,153
  • 16
  • 22
8
votes
4 answers

Varnish - Could not get hold of varnishd, is it running?

Running any of the commands varnishstat, varnishhist, varnishlog, varnishtop will give the error message as Could not get hold of varnishd, is it running? Below is some information for understanding. sudo service varnish status varnish.service -…
Sharath
  • 2,348
  • 8
  • 45
  • 81
8
votes
3 answers

REST API caching, should I use a Reverse proxy or memcache(d)?

I have a REST API where I would like to cache the JSON response of the index (GET /foo) and the read actions (GET /foo/1) to significantly increase the performance. When there is a POST or a PUT on a resource the cache entries for the index and read…
Ward Bekker
  • 6,316
  • 9
  • 38
  • 61
8
votes
1 answer

Varnish and Google Analytics

I don't quite understand how Google Analytics cookies work with Varnish. Do pages that contain GA cookie not get cached? Do I need to remove the GA cooke in vcl_recv? If I do remove them, does that stop GA tracking visitors?
Tom
  • 33,626
  • 31
  • 85
  • 109
8
votes
3 answers

Why isn't varnish taking into account the malloc limit?

I have varnish running with -s malloc,25G, but the process keeps growing until it consumes all the server memory and it crashes, restarting the cache. Any idea what I can check to see what's wrong? The server has 16 cores, and 32 GB of RAM. I am…
juan
  • 80,295
  • 52
  • 162
  • 195
8
votes
1 answer

How does Varnish know how long to cache each response for?

Does Varnish simply follow the Cache-Control header from the origin server? And are there any other ways that you can control how long it caches a response for? For example, can you tell Varnish to cache a response “indefinitely” (i.e. “until…
callum
  • 34,206
  • 35
  • 106
  • 163
7
votes
1 answer

What happens when Varnish Cache is full?

I'm using varnish with -s malloc,1G" It's currently 98% full. Once it completely full what will happen? Will it purge? Maybe purge old images/pages? Or better yet purge the files with least amount of hits?
Hayden
  • 361
  • 4
  • 18
7
votes
3 answers

Why does Django not generate CSRF or Session Cookies behind a Varnish Proxy?

Running Django 1.2.5 on a Linux server with Apache2 and for some reason Django seems like it cannot store CSRF or Session cookies. Therefore when I try to login to the Django admin it gives me a CSRF verification error upon submitting the login…
thomallen
  • 1,926
  • 1
  • 18
  • 32
7
votes
2 answers

How to do https in varnish?

I need accept https from client and my backend is also https. How can listen HTTPS in varnish and forward request to backend in HTTPS? VARNISH_LISTEN_PORT=443 # how to add SSL certs?
vego
  • 889
  • 1
  • 8
  • 20
7
votes
1 answer

After brew install varnish on OSX where can I find configuration file to change DAEMON_OPTS

After brew install varnish I would like to chenge some options in config file for example DAEMON_OPTS unfortunetlly I can't find this file. In linux it is in folders: Ubuntu: /etc/default/varnish CentOS 6.x: /etc/sysconfig/varnish CentOS 7.x:…
Marceli Po
  • 733
  • 1
  • 7
  • 24
7
votes
0 answers

Is it possible to have AWS ALBs pass through the X-Forwarded-Proto header?

I'm building an application with some rather arcane TLS and caching requirements, and I'm using a stack that looks like: HTTPS HTTP Nginx (443) Varnish (80) | | Varnish (80) Nginx (8080) \…
geerlingguy
  • 4,682
  • 8
  • 56
  • 92
7
votes
1 answer

What is the difference between bans and purge in varnish http-cache

Hi i'm a newbie in Varnish HTTP-Cache. I find it hard to understand the difference in concept between purging and banning cache invalidation. Anyone who can explain and differentiate banning and purging in varnish http-cache? Anyone? Thanks!
John Roca
  • 1,204
  • 1
  • 14
  • 27
7
votes
1 answer

Getting Apache 2.4 access logs to show client IP instead of 127.0.0.1 with Varnish using mod_remoteip

For the life of me, I couldn't get mod_remoteip to get client IPs in my Apache access logs. I'm working on a Virtualmin setup with Varnish 4 installed in front of Apache 2.4.7. How do you get it working?
curiouser
  • 970
  • 2
  • 12
  • 22