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

Varnish bypass a large file

I have Varnish installed with the default setting on my Apache web server. Apache listing to port 8080 and Varnish listing to 80. I have few downloadable files on the website with the sizes 100MB, 500MB and 1GB The 1GB is not working, when you click…
Sakhar
  • 55
  • 2
  • 9
3
votes
1 answer

Varnish under LB server

We have 2 file servers(Apache port-82) which is running under Load Balancer. And I have configured varnish successfully for a domain(imgs.site.com) in 2 servers(port-80) and its working properly when i put a host entry for the server but when i…
3
votes
1 answer

Varnish and SSL with Pound

I've set up my Varnish server as follows: backend web1 {.host = "XXX.XXX.XXX.XXX"; .port = "80";} backend web2 {.host = "XXX.XXX.XXX.XXX"; .port = "80";} backend web3 {.host = "XXX.XXX.XXX.XXX"; .port = "80";} backend web1_ssl {.host =…
gregavola
  • 2,519
  • 5
  • 30
  • 47
3
votes
1 answer

How can I configure Varnish to cache range requests?

I'm trying to configure Varnish to cache range requests. I notice the http_range_support option, but everything I've read says that this will attempt to cache the entire file before satisfying the request. Is it possible to do so without requiring…
wkf
  • 842
  • 9
  • 17
3
votes
2 answers

Varnish - How to cache logged-in users

I installed varnish and everything works OK. However, I have a need to cache logged-in users. This is what I have in my VCL: backend default { .host = "127.0.0.1"; .port = "8080"; } sub vcl_recv { unset req.http.Cookie; if…
Frankline
  • 40,277
  • 8
  • 44
  • 75
3
votes
1 answer

Dynamically adding or removing backend hosts to Varnish

What's the best way to programmatically add or remove individual backend servers to/from a Varnish director without downtime? I've been looking for a good example of this and cannot find one. I would like to be able to scale my backend servers up…
user1950119
  • 181
  • 1
  • 2
  • 4
3
votes
1 answer

Varnish 3 - how to set maximum age in http headers

I am using Varnish 3.0.3 and to use it to leverage browser caching by setting a maximum age in the HTTP headers for static resources. I tried adding the following configuration to default.vcl: sub vcl_fetch { if (beresp.cacheable) { /* Remove…
Snels Nick
  • 925
  • 3
  • 13
  • 25
3
votes
1 answer

Varnish microcaching

Micro-caching and Nginx can really speed up the app. Would it be possible to use micro-caching (or something similar) with Varnish?
Vladimir
  • 335
  • 1
  • 7
  • 24
3
votes
3 answers

Varnish cache - how long the pages are cached?

I have a doubt regarding the working of vanish cache. I installed the varnish cache with my apache web sever and configured the same correctly, so that I can access web pages through varnish cache. The question is here, that I have created a…
iqbalmp
  • 607
  • 1
  • 14
  • 24
2
votes
3 answers

How can I use varnish to send requests to localhost httpd server but if unhealthy send the request round-robin to a group of other nodes

We have a set of 6 backends that serve our website. Because we use multiple datacenters we have found the best performance occurs for us when we have varnish send the request to the localhost httpd server (running on port 81). This of course is a…
user1254723
  • 181
  • 1
  • 8
2
votes
1 answer

varnish serve old object during refresh

How can I serve an old object during the fetch of an expired object or max out connection? I¹ve configured the grace period in both the vcl_recv as the vcl_fetch. I even tried to use the saint mode to give me back an ³old² cached object. Can…
2
votes
1 answer

What is the best way to debug a VCL file?

I am writing inline C in my VCL file. More specifically I am using Maxmind's GeoIP database to geocode a visitor's IP. I have everything installed, I have followed all the wiki examples for GeoIP database and everything works swimmingly. I am trying…
Arlo Carreon
  • 441
  • 1
  • 4
  • 11
2
votes
4 answers

Good way to choose between backends by Varnish depending on requested file existence

I have the installation with Apache2, nginx and Varnish above them. Varnish receives the request, determines what backend is it for (static goes to nginx, dynamic goes to Apache), fetches the response from backend and caches it if needed. Amongst…
WASD42
  • 2,352
  • 6
  • 27
  • 41
2
votes
1 answer

Why would varnish.service suddenly change its port? (From 80 to 6081)

I have a WordPress site with gunicorn and varnish running on an AWS instance. This morning, the website gave a "502 Bad Gateway nginx" error. Upon investigation, it looks like the varnish.service port was: ExecStart=/usr/sbin/varnishd -j…
Chris
  • 500
  • 6
  • 25
2
votes
2 answers

Varnish http_req_hdr_len parameter not working for request header size > 8KB

I am trying to set the max request header size as 16KB in the varnishd command. Here is how varnishd command looks like: /usr/sbin/varnishd \ -P /var/run/varnish.pid \ -f $VARNISH_VCL_CONF \ -a…
Vivek
  • 137
  • 2
  • 17