清漆

2012-03-11 132 views
0

删除饼干,我有以下VCL:清漆

sub jamie_fetch 
{ 
    if(beresp.http.X-Var-Cache == "YES") { 
     unset beresp.http.Set-Cookie; 
     set beresp.http.X-Cacheable = "YES"; 
     set beresp.grace = 365d; 
     set beresp.ttl = 365d; 

     return(deliver); 
    } 

    set beresp.http.X-Cacheable = "NO"; 

    return(hit_for_pass); 
} 

我知道这部分工作,因为我得到了下面的头当我第一次访问该页面:

X-Cacheable:YES 

但是我也得到:

Set-Cookie:foobar 

我假设我在下面犯了一个错误:

unset beresp.http.Set-Cookie; 

但是从我的搜索看来似乎是正确的?如果有更多经验的人能够指引我朝着正确的方向发展,我将不胜感激。

预先感谢任何帮助/提示/使用unset当指针:-)

+0

在我们所有的VCL文件,我们小写头在未设置' '电话。但是我不记得,也找不到任何明确表示这会导致你的问题的东西。 – 2012-03-11 00:35:06

+0

就是这样!谢谢 :-) – james 2012-03-11 00:45:20

回答

1

你应该小写头名:

unset beresp.http.set-cookie;