Questions tagged [varnish-vcl]

The Varnish Configuration Language (VCL) is a small domain-specific language used to define request handling and caching policies for the Varnish HTTP accelerator. Do not confuse this with the Visual Component Library (VCL) used in Delphi and C++Builder. Use the "vcl" tag for questions related to those products.

The VCL language is a small domain-specific language designed to be used to define request handling and document caching policies for the Varnish HTTP accelerator. When a new configuration is loaded, the varnishd management process translates the VCL code to C and compiles it to a shared object which is then dynamically linked into the server process.

The VCL documentation can be found on the documentation site.

677 questions
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

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

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

Is it possible to prevent caching based on the size of the backend response in Varnish?

We're caching for a problematic IIS server that sometimes just sends empty responses (0 bytes) instead of proper ones. Caching these responses would be a disaster, and we have no way of fixing the problem as it's not our server. Instead I'd like to…
Hubro
  • 56,214
  • 69
  • 228
  • 381
6
votes
1 answer

Varnish 3: "Expected return action name" when using "synth"

Using Varnish 3.0.7. In order to forward any non-SSL connections I've added the following subroutine to my VCL: sub vcl_synth { if (resp.status == 750) { set resp.status = 301; set resp.http.Location = req.http.x-redir; …
Fredrik
  • 1,741
  • 4
  • 24
  • 40
6
votes
1 answer

Varnish: Purge says it works but doesn't remove old content

I'm running a stand alone instance of varnish on a Digital Ocean Ubuntu VM which basically works fine. The setup is used to take load of an older wordpress server that sits anyhwere else. That works quite well but i'm having a hard time getting…
Helmi
  • 489
  • 7
  • 25
6
votes
1 answer

Varnish 4, Purging - I thought I had it all figured out

Well, I'll keep it simple, PURGE requests (or so I thought?) were pretty much all handled by literally: acl purge { "localhost"; "127.0.0.1"; } and then if (req.method == "PURGE") { if (!client.ip ~ purge) { …
alturic
  • 53
  • 2
  • 8
6
votes
2 answers

Make Varnish ignore requests with Cookie header

Varnish default behaviour is to never lookup for requests containing a Cookie header. In other words, a request containing a Cookie header will never be cached. I need to override this behaviour to just ignore requests with a Cookie header. Consider…
Alberto Fernández
  • 1,568
  • 13
  • 22
6
votes
4 answers

Varnish cache - How to purge/delete cache only for Home page

I'm using Drupal 7 latest dev version. I have installed Varnish and Expire modules and setup them. They are working very well but I have one problem regarding deleting cache from varnish. The problem is how to delete varnish cache only for…
Danilo Puric
  • 779
  • 2
  • 13
  • 23
6
votes
3 answers

Varnish Client IP not logging in Apache Logs

I've configured Varnish 3 with Apache and it is running perfectly alright. However i'm unable to get the Client ip logged in Apache logs. I tried a few solutions googling around with no luck. Right now my Apache access log file is logging the server…
Raheel Dharolia
  • 203
  • 1
  • 4
  • 13
5
votes
2 answers

how to get request body in varnish

I am currently working on a project based on varnish.. we write vcl and vmod. But the project needs to check the request body. How can I get the post request body in VCL or vmod with a C function?
StevenWang
  • 3,625
  • 4
  • 30
  • 40
5
votes
2 answers

Can Varnish be configured to try a second server for some resource if it gets a 404 from the primary server?

This would be a perfect solution for me as I need to serve some generated content to web browsers. My plan is to generate the content on demand and store it for next time. I don't want the browsers to call my service (which generates the content)…
5
votes
1 answer

Does Varnish cache 404s by default?

I was really surprised that I've had this much trouble finding this answer anywhere, but I can't. With the built-in VCL in vcl_recv, etc., in Varnish 4.0+, does Varnish cache 404 responses by default?
jdotjdot
  • 16,134
  • 13
  • 66
  • 118
1
2
3
45 46