Skip to content

gianlucagilardi/varnish3to4

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 

Repository files navigation

varnish3to4

Unofficial script to assist migrating a VCL file from Varnish 3 to 4.

Suggested usage

 $ varnish3to4 -o <filename>.v4 <filename>
 $ diff -u <filename> <filename>.v4

Currently understands

V3 V4
vcl_fetch vcl_backend_response
vcl_error vcl_backend_error and vcl_synth
error code response return (synth(code, response))
purge -
remove unset
{bereq,req}.request {bereq,req}.method
{beresp,obj,resp}.response {beresp,obj,resp}.reason
{bereq,req}.backend.healthy std.healthy({bereq.backend,req.backend_hint})
beresp.storage beresp.storage_hint
req.backend req.backend_hint
req.grace -
req.* in vcl_backend_response bereq.*
{client,server}.port std.port({client,server}.ip)
return (hit_for_pass) set beresp.uncacheable = true;
return (deliver);
return (lookup) in vcl_recv return (hash)
return (hash) in vcl_hash return (lookup)
return (pass) in vcl_pass return (fetch)
return (restart) in vcl_fetch return (retry)
synthetic .. synthetic(..)
obj.* in vcl_synth resp.*
obj.hits - writing to -
obj.lastuse -

Might be implemented

V3 V4
  • | vcl 4.0
  • | import directors
    new xx = directors.yy();
    xx.add_backend(ss);
    set req.backend_hint = xx.backend()

Add imports resulting from changes in V4, purge handling and any other changes missing from this document.

About

Varnish 3 to 4 migration script

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published