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: How to keep user cookies while caching per page not per user

I have a page that have a content that will be displayed to all users, but the issue is I have an ajax call done after page load this call is not cacheable but it requires cookies which is removed from the cached page, what can I do to to keep the…
Mustafa Abuelfadl
  • 537
  • 1
  • 4
  • 20
0
votes
1 answer

how to check cookie expiration in Varnish

In my application, when user logged in, we don't want to cache any content. So we bypass user directly to backend. we don't that like following. if (req.http.cookie ~ "(isLoggedIn)") { return (pass);} This work as expected. Now, issue is if user log…
jvm
  • 1,662
  • 8
  • 27
  • 46
0
votes
1 answer

Django and Varnish

I am currently working on a large website in django(very complex data structure), natively, the load support is extremely low(4 req/s), which is unacceptable, I was advised to use varnish to speed up my application. Now here is where the problem…
flaiks
  • 269
  • 3
  • 13
0
votes
1 answer

Varnish VCL & Req.Url matching for redirects

I currently Varnish set up for general caching etc, but also acting as a redirect for a mobile version of our website. It works great (as Varnish does!) and redirects as intended. I decided to add functionality to the VCL config to not just redirect…
flukeflume
  • 707
  • 1
  • 6
  • 14
-1
votes
1 answer

How do I know if Varnish cache is working on my WordPress website?

I have a WordPress website installed on my Cloudways managed server. Cloudways offer Varnish cache and I have that enabled from the server side. In my WordPress website, I have installed a plugin called WP Fastest Cache plugin, and entered the IP…
Shiva
  • 321
  • 2
  • 6
  • 14
-1
votes
1 answer

Setup varnish just for subdomain?

Can I setup Varnish for one Subdomain and block it for all other Domains on my server? Will this code work? backend magento244.example.com { .host = "magento244.example.com"; .port = "8080"; .first_byte_timeout = 600s; .probe =…
Oscar
  • 27
  • 1
  • 6
-1
votes
1 answer

Varnish Docker image not working for node js On localhost

I am trying to implement Varnish for a small small node js server (index.js) const port = 80; require("http").createServer((req, res) => { res.write(new Date().toISOString()); res.end(); }).listen(port, () => { …
kunal verma
  • 456
  • 5
  • 13
-1
votes
1 answer

Varnish Cache, How do I route client traffic based on client source IP address?

@varnishcache HELP! How do I route client traffic based on client source IP address? N.B: I have install two varnish-cache servers in two different data center.
janbegjan
  • 1
  • 1
-1
votes
1 answer

Varnish Pass - request coalescing

I have a varnish 4 setup with - nginx ssl termination -> varnish -> varnish rr to 4 apache backends We need to basically not cache any requests where a specific cookie isn't set on the incoming request, so in my vcl_recv I have: if (!req.http.Cookie…
Pablo R
  • 33
  • 4
-1
votes
1 answer

Varnish with MPEG-TS Traffic

We are trying use Varnish as proxy/cache for our media server. Our streams are MPEG-TS (h264/h265) over http. There is 1000 live streams on this media server and each stream getting multiple connection. We tried to configure Varnish shown as below…
Talion
  • 1
-1
votes
1 answer

Varnish ESI caching - remote url returns 404

I'm trying to have a Varnish ESI caching on my local setup. I did create a sample html file called index.html.

Hello!!~~

-1
votes
1 answer

Varnish policy engine on Ubuntu

I'm following the Varnish docs relating to policy-engine and am confused how to install it on Ubuntu. I can't find any repo that seems to have it or any trace of how to install it online. Has it been renamed or something? I'm using Varnish 6.0 on…
rix
  • 10,104
  • 14
  • 65
  • 92
-1
votes
1 answer

include ,an error occurred at the start

I use following code in default.vcl C{#include }C an error occurred at the start. Message from C-compiler: ./vcl.TfBe17Rg.c:429:21: time.h: No such file or directory ./vcl.TfBe17Rg.c:430:23: string.h: No such file or directory …
sealzrt
  • 1
  • 1
-1
votes
1 answer

Varnish 4 VCL type conversions?

I'm using Varnish4 with the geoip vmod and I'm trying to use client.ip as a string. geoip.country_code(client.ip); When doing this, I am presented with the error Wrong argument type. Expected STRING. Got IP. If I really wanted I could just do…
castis
  • 8,154
  • 4
  • 41
  • 63
-1
votes
1 answer

Redirect all png requests as jpg requests in Varnish

I want to redirect all .png requests to .jpg requests in Varnish VCL Example: http://example.com/images/boy.png (or .PNG) to http://example.com/images/boy.jpg in Varnish VCL
Krishna
  • 1,956
  • 3
  • 15
  • 25
1 2 3
45
46