【问题标题】:'beresp.ttl': cannot be set in method 'vcl_hit' in Varnish 4.0“beresp.ttl”:无法在 Varnish 4.0 的方法“vcl_hit”中设置
【发布时间】:2014-11-30 02:50:48
【问题描述】:

我正在尝试将我的旧 Varnish 配置导入到 4.0 版。

sub vcl_hit {
     if (req.method == "PURGE") {
          set beresp.ttl = 0s;
          return (synth(200, "Purged."));
     }
}

我得到的错误:

Message from VCC-compiler:
'beresp.ttl': cannot be set in method 'vcl_hit'.
At: ('input' Line 135 Pos 15)
          set beresp.ttl = 0s;
--------------##########------

Running VCC-compiler failed, exited with 2

那么我该如何更新呢?

【问题讨论】:

    标签: varnish varnish-vcl


    【解决方案1】:

    那不行 ;) 有一个完整的迁移指南如何从 3 迁移到 4

    https://www.varnish-cache.org/docs/trunk/whats-new/upgrading.html

    这里是一个完整的列表,其中有哪些更改以及如何修复它。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-16
    • 1970-01-01
    • 2022-12-13
    • 2017-05-23
    • 1970-01-01
    相关资源
    最近更新 更多