In Varnish there are some differences between VCL 2.x and 3.0. Hash generation for example. In Varnish 2.x you'd do req.hash += somevar while in Varnish 3.x you would call hash_data(somevar).

Is it possible to write portable Varnish scripts that work on both 2.x and 3.x? Can I if on the Varnish version for example?

有帮助吗?

解决方案

No, it's not possible since Varnish compile vcl configs in C prior to start, so you should translate the config to the right version before or you will get a compile error.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top