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
7
votes
1 answer

obj.ttl in Varnish 4.0

Question about obj.ttl in Varnish 4.0 I have a small varnish problem and hope anyone can help me. I am using varnish 4.0 and I want to increase the obj.ttl based on the obj.hits sub vcl_hit { if (obj.hits == 1000) { set obj.ttl = 7d; …
user3589380
  • 91
  • 1
  • 2
  • 6
7
votes
2 answers

Can I Vary on a custom header?

I'm bucketing User-Agents by device using something like varnish-devicedetect and storing the result in X-UA-Device on the request and the response. I've seen several recommendations to vary on User-Agent. Any reason not to vary instead on…
hurrymaplelad
  • 26,645
  • 10
  • 56
  • 76
7
votes
2 answers

Correct way of setting up varnish for caching django sites

I have just set up a server with just varnish installed in front of my backend server, where I have two different django sites, being served through nginx+gunicorn It seem to work, but I get Header Age = 0, and looking at the documentation, that's…
Tomas Jacobsen
  • 2,368
  • 6
  • 37
  • 81
7
votes
3 answers

How can I check why a Varnish probe fails?

I'm used to run varnishadm -T localhost:6082 debug.health to check the backends health status, but how can I check why a probe fails in details (eg timeouts, wrong http status code)?
Gabriele Perego
  • 113
  • 2
  • 2
  • 7
7
votes
1 answer

How to Deal with Cookies in Varnish stack

Due to slow performance of the site, I started looking info Varnish as a caching solution and have some questions about Google Analytics. When there are 5K active users on the site (according to GA's live traffic report), the server loads on…
Nerses
  • 709
  • 2
  • 9
  • 15
7
votes
2 answers

How to read output of varnishtop?

Using varnish-cache, I am running varnishtop -c -i RxURL to show number of client requests from the cache. The output looks somewhat like this: list length 40 …
Shlomi Noach
  • 9,073
  • 1
  • 23
  • 20
7
votes
3 answers

How do I do HTTP Purge from Java?

I'm trying to perform a PURGE with HttpUrlConnection like this: private void callVarnish(URL url) { HttpURLConnection conn = null; try { conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod(PURGE_METHOD); …
jakob
  • 5,979
  • 7
  • 64
  • 103
7
votes
1 answer

What is the point of Varnish and Rack-Cache for a Rails app?

I am a bit confused about the purpose of Varnish and Rack-Cache for a Rails app. In config/environments/production.rb caching can be set with something like config.static_cache_control = "public, max-age=3600" Given that, what exactly is the purpose…
user782220
  • 10,677
  • 21
  • 72
  • 135
6
votes
1 answer

Incrementing a Page View Count with Varnish and ESI

If I am using Varnish to cache my entire documents, by what mechanism would you advise I increment a page view count as well. For example, lets supose that I have an auction listing, such as ebay, and I would like to cache the entire page since I…
Layke
  • 51,422
  • 11
  • 85
  • 111
6
votes
2 answers

Varnish Sort Querystring Parameter

I've got a lot of requests that avoid caching because all of their list permutations are listed, ie: http://.....&var=a,b,c http://.....&var=a,c,b http://.....&var=b,a,c http://.....&var=b,c,a http://.....&var=c,a,b http://.....&var=c,b,a Is there…
Stefan Mai
  • 23,367
  • 6
  • 55
  • 61
6
votes
1 answer

How to configure ulimit with supervisord (to start varnish)

I am migrating a server configuration to supervisord (from init.d files). There are a few instances of varish running. I remember when I started using varnish I had ulimit problems so there is the following lines in the init.d/varnish scripts ulimit…
Kevin Gill
  • 61
  • 1
  • 3
6
votes
4 answers

Varnish DAEMON_OPTS Options Errors

When using inline C with Varnish I've not been able to get /etc/varnish/default to be happy at startup. I've tested inline C with varnish for two things: GeoIP detection and Anti-Site-Scraping functions. The DAEMON_OPTS always complains even though…
Jacob
  • 61
  • 1
  • 1
  • 4
6
votes
1 answer

Varnish + nginx ssl + woocommerce - wc-ajax not behaving

So Ive got a bit of a weird one. I have a debian 9 machine running with Nginx, Varnish, php-fpm and wordpress/woocommerce. The site essentially works, but Im having some weird issues with adding to cart. The test environment is up at…
Mike
  • 511
  • 3
  • 10
  • 28
6
votes
3 answers

How to Remotely force a client to purge a cached website?

We are experiencing an issue where a previous version of our home page is being displayed. Even though there has been changes since then, the web page will always show the old version. This issue stems from us using a WordPress plugin that added…
Louay Cheikh
  • 63
  • 1
  • 1
  • 5
6
votes
1 answer

Varnish FetchError overflow

I am Getting a lot of varnish 503 error un uncached pages , all these error have one thing in common , checking varnish logs it stats "FetchError overflow". Also error is not consistent , sometimes its error and other times page open Perfectly. My…
Manu Atrey
  • 61
  • 4