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

Varnish: having trouble getting basic caching to work as expected

I'm learning Varnish, and I am having trouble understanding some very basics. I have created a simple file i want Varnish to store in cache, called test.php and it looks like this:
Pål
  • 958
  • 2
  • 13
  • 18
0
votes
1 answer

Unable to purge using CURL on VARNISH

I am unable to purge objects in varnish using CURL CURL command: curl -X PURGE localhost/public/stylesheets/main.css -v the curl command is returning 200 OK response. the object is not getting purged config file in VARNISH : default.vcl sub…
0
votes
1 answer

varnish not kicking in for www-version of domain

I have setup varnish on a server that runs two sites on two different domains, varnish works perfect without www in front of the two domains, I have attached the vcl file in this pastebin, I guess it's a basic misconfiguration somewhere, but I can't…
user2210889
  • 123
  • 2
  • 8
0
votes
2 answers

Varnish: How to send hit/miss stats to backend

I hope you can help I have a image server that generates images on the fly. I'm using varnish to cache generated images. I need to record how many requests (per image) varnish receives as well as if it was a hit or miss (pass gets marked as miss). …
NeilA
  • 1,450
  • 2
  • 12
  • 20
0
votes
2 answers

Varnish removes Public IP from X-Forwarded-for

I am facing an issue where varnish is not sending Intermediary proxy IP or Public IP in a particular case. Scenario is as below : Some Hotel / Company has squid proxy configured and all traffic for Internet is routed via Squid. User accessing my…
KeyurM
  • 388
  • 1
  • 3
  • 12
0
votes
1 answer

Varnish settings to run with magento

I am creating an ecommerce site using magento. I am using nginx, php5-fpm. I have 512mb RAM and 4CPU cores. I want to use varnish with these specifications. I want to know what values should i set in the varnish configuration so that my server can…
MJQ
  • 1,778
  • 6
  • 34
  • 60
0
votes
1 answer

Can Varnish evaluate the HTML in the response to determine whether to cache?

I'd like to exclude certain pages from the Varnish cache based on the content of the page (for instance if the Form uses a particular hidden field which is a security feature and needs to be unique on every page refresh). I have dozens of forms, so…
0
votes
1 answer

Why the beresp.ttl is set to 0 when a Cookie is added to the request in Varnish?

Ok, so I'm trying to make Varnish works properly and I've a weird behavior I can't explain (may be due by a lack of understanding). Here is what I'm trying to do: GET http://scm.dev:6081/articles If-None-Match:…
Boris Guéry
  • 47,316
  • 8
  • 52
  • 87
0
votes
3 answers

Regex match anything that is not sub-pattern

I have cookies in my HTTP header like so: Set-Cookie: frontend=ovsu0p8khivgvp29samlago1q0; adminhtml=6df3s767g199d7mmk49dgni4t7; external_no_cache=1; ZDEDebuggerPresent=php,phtml,php3 and I need to extract the 26 character string that comes after…
james
  • 792
  • 7
  • 15
0
votes
1 answer

what's an easily scalable way to set a cookie on my domain?

I am trying to do some simple cookie tracking and need to find an easily scalable way to set a cookie. The setup needs only to set a cookie, no server side logic needed, no uniqueness or token required. Something as simple as "HAS_VISITED=true;"…
browep
  • 5,057
  • 5
  • 29
  • 37
0
votes
1 answer

In Varnish, how can I read the Set-Cookie response header?

I am trying to detect if my application has set a cookie that holds an "alert message" for the user on the next page, where the Javascript displays it if detected. In my vcl_fetch(), I need to detect if the specific cookie value "alert_message"…
Adam Friedman
  • 520
  • 6
  • 20
0
votes
1 answer

Security.vcl varnish configuration.?

I Have configure varnish. Now i want to configure security.vcl on it. I am following this link http://www.slideshare.net/kimlindholm/varnish-configuration-step-by-step. i've configure each step carefully. But when I try to visit on links provided…
Muneeb Nasir
  • 2,414
  • 4
  • 31
  • 54
0
votes
1 answer

varnish 3 and multiple IPs (virtualhosts) isn't working out too well for me

Complete newbie to Varnish so apologies ahead of time if this seems rather silly. Here's the situation. I have a server with 5 IPs. Using ISPconfig for most tasks but that's probably irrelevant. I have multiple apache virtual hosts configured across…
Nik
  • 21
  • 1
  • 5
0
votes
1 answer

How to generate a list of PASS url's in varnishlog?

I'm trying to generate a simple list of url's that get a 'PASS' from Varnish. varnishlog is a great utility, but it appears that it can't do this task, as it primarily logs HITS, and has no tag for PASS. Any idea if there is a way to log this?…
samtresler
  • 663
  • 1
  • 7
  • 8
0
votes
3 answers

Varnish not sending PHPSESSID cookie

I am running Varnish 3.0 in front of an Apache2 + PHP 5.3 server. My problem was that Varnish threw many 503 Service Unavailable errors, so I added a workaround, saying something like: if http_code = 503 and cookie(REDIRECTED) = false set-cookie…
Eduard Luca
  • 6,514
  • 16
  • 85
  • 137