<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
<font size="-1">Hi,<br>
<br>
Is it possible to set obj.ttl to the value getting from a backend
response header. My application is calculating the TTL value and
setting a header "upstream-ttl". I'm using below syntax in vcl_fetch
but it's not working.<br>
<br>
13 ObjStatus c 200<br>
13 ObjResponse c OK<br>
13 ObjHeader c Date: Mon, 22 Mar 2010 10:36:16 GMT<br>
13 ObjHeader c Server: Apache/2.2.9 (Unix) PHP/5.2.5<br>
13 ObjHeader c X-Powered-By: PHP/5.2.5<br>
13 ObjHeader c <b>upstream-ttl: 5867221s</b><br>
13 ObjHeader c Content-Type: text/xml;charset=UTF-8<br>
<br>
vcl_fetch {<br>
if (req.http.host ~ "^xx.example.com") {<br>
if (req.url ~ "^/index*") {<br>
set obj.http.Cache-Control = "max-age=604800";<br>
set obj.ttl = 7d;<br>
} else {<br>
set obj.ttl = beresp.http.upstream-ttl;<br>
}<br>
deliver;<br>
}<br>
}<br>
<br>
Regards,<br>
Mahesh.<br>
</font>
<br>
</body>
</html>