Weird "^" in the regex of varnish

Junxian Yan junxian.yan at
Mon Mar 7 16:56:09 CET 2011

Hi Guys

I encountered this issue in two different environment(env1 and env2).
The sample code is like:
in vcl_fetch()

  else if (req.url ~ "^/tables/\w{6}/summary.js") {
    if (req.http.Set-Cookie !~ " u=\w") {
      unset beresp.http.Set-Cookie;
      set beresp.ttl = 2h;
      set beresp.grace = 22h;
    } else {

In env1, the request like enter lookup and
then enter fetch to create a new cache entry. Next
time, the same request will hit cache and do not do fetch anymore
In env2, the same request enter and go into vcl_fetch, the regex will fail
and can not enter deliver, so the resp will be sent to end user without
cache creating.

I'm not sure if there is somebody has the same issue. Is it platform related

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list