varnish vcl syntax

X.H.R.F.C. xhrfc at yahoo.com
Fri Jun 22 18:36:27 CEST 2012


Hello, 

Is there any way to get variable from regex and setup ttl ?

example:
application :

PHP
$this->response->headers(array('Content-Type' => 'text/html', 'esi-enabled' => 'true | 20m'));


VARNISH
if (beresp.http.esi-enabled ~ "true | [0-9a-z]+$") {
        set beresp.ttl = regsub(beresp.http.esi-enabled,"([0-9a-z]+$)","\0");
        unset beresp.http.esi-enabled;
}

after varnish restart i get:
Stopping HTTP accelerator: varnishd failed!
Starting HTTP accelerator: varnishd failed!
Message from VCC-compiler:
Expression has type STRING, expected DURATION

Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20120622/e3f12826/attachment.html>


More information about the varnish-misc mailing list