diff options
| author | Georg Brandl <georg@python.org> | 2021-01-18 21:24:00 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2021-01-18 22:08:36 +0100 |
| commit | 2a3d3a7d5b9c60dedf6638d876161d9563faebcf (patch) | |
| tree | 809c0b4a686db98f5954afa1944404cd9652c6b2 /tests/lexers/vcl/example.txt | |
| parent | f0445be718da83541ea3401aad882f3937147263 (diff) | |
| download | pygments-git-examplefiles.tar.gz | |
Move test_examplefiles to new tests/lexers scheme.examplefiles
Diffstat (limited to 'tests/lexers/vcl/example.txt')
| -rw-r--r-- | tests/lexers/vcl/example.txt | 1763 |
1 files changed, 1763 insertions, 0 deletions
diff --git a/tests/lexers/vcl/example.txt b/tests/lexers/vcl/example.txt new file mode 100644 index 00000000..b8d0acd5 --- /dev/null +++ b/tests/lexers/vcl/example.txt @@ -0,0 +1,1763 @@ +---input--- +# This is the VCL configuration Varnish will automatically append to your VCL +# file during compilation/loading. See the vcl(7) man page for details on syntax +# and semantics. +# New users is recommended to use the example.vcl file as a starting point. + +vcl 4.0; + +backend foo { .host = "192.168.1.1"; } + +probe blatti { .url = "foo"; } +probe fooy { + .url = "beh"; + +} + +acl foo { + "192.168.1.1"; + "192.168.0.0"/24; + ! "192.168.0.1"; +} + +include "foo.vcl"; + +import std; + +sub vcl_init { + new b = director.foo(); +} + +sub vcl_recv { + ban(req.url ~ "foo"); + rollback(); +} +sub vcl_recv { + if (req.method == "PRI") { + /* We do not support SPDY or HTTP/2.0 */ + return (synth(405)); + } + if (req.method != "GET" && + req.method != "HEAD" && + req.method != "PUT" && + req.method != "POST" && + req.method != "TRACE" && + req.method != "OPTIONS" && + req.method != "DELETE") { + /* Non-RFC2616 or CONNECT which is weird. */ + return (pipe); + } + + if (req.method != "GET" && req.method != "HEAD") { + /* We only deal with GET and HEAD by default */ + return (pass); + } + if (req.http.Authorization || req.http.Cookie) { + /* Not cacheable by default */ + return (pass); + } + return (hash); +} + +sub vcl_pipe { + # By default Connection: close is set on all piped requests, to stop + # connection reuse from sending future requests directly to the + # (potentially) wrong backend. If you do want this to happen, you can undo + # it here. + # unset bereq.http.connection; + return (pipe); +} + +sub vcl_pass { + return (fetch); +} + +sub vcl_hash { + hash_data(req.url); + if (req.http.host) { + hash_data(req.http.host); + } else { + hash_data(server.ip); + } + return (lookup); +} + +sub vcl_purge { + return (synth(200, "Purged")); +} + +sub vcl_hit { + if (obj.ttl >= 0s) { + // A pure unadultered hit, deliver it + return (deliver); + } + if (obj.ttl + obj.grace > 0s) { + // Object is in grace, deliver it + // Automatically triggers a background fetch + return (deliver); + } + // fetch & deliver once we get the result + return (miss); +} + +sub vcl_miss { + return (fetch); +} + +sub vcl_deliver { + set resp.http.x-storage = storage.s0.free; + return (deliver); +} + +/* + * We can come here "invisibly" with the following errors: 413, 417 & 503 + */ +sub vcl_synth { + set resp.http.Content-Type = "text/html; charset=utf-8"; + set resp.http.Retry-After = "5"; + synthetic( {"<!DOCTYPE html> +<html> + <head> + <title>"} + resp.status + " " + resp.reason + {"</title> + </head> + <body> + <h1>Error "} + resp.status + " " + resp.reason + {"</h1> + <p>"} + resp.reason + {"</p> + <h3>Guru Meditation:</h3> + <p>XID: "} + req.xid + {"</p> + <hr> + <p>Varnish cache server</p> + </body> +</html> +"} ); + return (deliver); +} + +####################################################################### +# Backend Fetch + +sub vcl_backend_fetch { + return (fetch); +} + +sub vcl_backend_response { + if (beresp.ttl <= 0s || + beresp.http.Set-Cookie || + beresp.http.Surrogate-control ~ "no-store" || + (!beresp.http.Surrogate-Control && + beresp.http.Cache-Control ~ "no-cache|no-store|private") || + beresp.http.Vary == "*") { + /* + * Mark as "Hit-For-Pass" for the next 2 minutes + */ + set beresp.ttl = 120s; + set beresp.uncacheable = true; + } + return (deliver); +} + +sub vcl_backend_error { + set beresp.http.Content-Type = "text/html; charset=utf-8"; + set beresp.http.Retry-After = "5"; + synthetic( {"<!DOCTYPE html> +<html> + <head> + <title>"} + beresp.status + " " + beresp.reason + {"</title> + </head> + <body> + <h1>Error "} + beresp.status + " " + beresp.reason + {"</h1> + <p>"} + beresp.reason + {"</p> + <h3>Guru Meditation:</h3> + <p>XID: "} + bereq.xid + {"</p> + <hr> + <p>Varnish cache server</p> + </body> +</html> +"} ); + return (deliver); +} + +####################################################################### +# Housekeeping + +sub vcl_init { +} + +sub vcl_fini { + return (ok); +} + +---tokens--- +'# This is the VCL configuration Varnish will automatically append to your VCL' Comment +'\n' Text + +'# file during compilation/loading. See the vcl(7) man page for details on syntax' Comment +'\n' Text + +'# and semantics.' Comment +'\n' Text + +'# New users is recommended to use the example.vcl file as a starting point.' Comment +'\n' Text + +'\n' Text + +'vcl ' Keyword.Reserved +'4.0' Name.Constant +';' Punctuation +'\n' Text + +'\n' Text + +'backend' Keyword +' foo' Name.Variable.Global +' {' Punctuation +' ' Text +'.host' Name.Attribute +' = ' Operator +'"' Literal.String +'192.168.1.1' Literal.String +'"' Literal.String +';' Punctuation +' ' Text +'}' Punctuation +'\n' Text + +'\n' Text + +'probe ' Keyword +'blatti ' Name.Variable.Global +'{' Punctuation +' ' Text +'.url' Name.Attribute +' = ' Operator +'"' Literal.String +'foo' Literal.String +'"' Literal.String +';' Punctuation +' ' Text +'}' Punctuation +'\n' Text + +'probe ' Keyword +'fooy ' Name.Variable.Global +'{' Punctuation +'\n' Text + +'\t' Text +'.url' Name.Attribute +' = ' Operator +'"' Literal.String +'beh' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +'\n' Text + +'}' Punctuation +'\n' Text + +'\n' Text + +'acl ' Keyword +'foo ' Name.Variable.Global +'{' Punctuation +'\n' Text + +'\t' Text +'"' Literal.String +'192.168.1.1' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +'\t' Text +'"' Literal.String +'192.168.0.0' Literal.String +'"' Literal.String +'/' Operator +'24' Literal.Number +';' Punctuation +'\n' Text + +'\t' Text +'!' Operator +' ' Text +'"' Literal.String +'192.168.0.1' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +'}' Punctuation +'\n' Text + +'\n' Text + +'include' Keyword +' ' Text +'"' Literal.String +'foo.vcl' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +'\n' Text + +'import' Keyword +' ' Text +'std' Name +';' Punctuation +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_init' Name.Function +' {' Punctuation +'\n' Text + +'\t' Text +'new' Keyword +' ' Text +'b' Name +' ' Text +'=' Operator +' ' Text +'director' Name.Function +'.' Punctuation +'foo' Name.Function +'(' Punctuation +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_recv' Name.Function +' {' Punctuation +'\n' Text + +'\t' Text +'ban' Keyword +'(' Punctuation +'req.url' Name.Variable +' ' Text +'~' Operator +' ' Text +'"' Literal.String +'foo' Literal.String +'"' Literal.String +')' Punctuation +';' Punctuation +'\n' Text + +'\t' Text +'rollback' Keyword +'(' Punctuation +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'sub ' Keyword +'vcl_recv' Name.Function +' {' Punctuation +'\n' Text + +' ' Text +'if' Keyword +' ' Text +'(' Punctuation +'req.method' Name.Variable +' ' Text +'==' Operator +' ' Text +'"' Literal.String +'PRI' Literal.String +'"' Literal.String +')' Punctuation +' ' Text +'{' Operator +'\n' Text + +'\t' Text +'/*' Comment.Multiline +' We do not support SPDY or HTTP' Comment.Multiline +'/' Comment.Multiline +'2.0 ' Comment.Multiline +'*/' Comment.Multiline +'\n' Text + +'\t' Text +'return' Keyword +' ' Text +'(' Punctuation +'synth' Name.Constant +'(' Punctuation +'405' Literal.Number +')' Punctuation +')' Punctuation +';' Punctuation +'\n' Text + +' ' Text +'}' Operator +'\n' Text + +' ' Text +'if' Keyword +' ' Text +'(' Punctuation +'req.method' Name.Variable +' ' Text +'!=' Operator +' ' Text +'"' Literal.String +'GET' Literal.String +'"' Literal.String +' ' Text +'&&' Operator +'\n' Text + +' ' Text +'req.method' Name.Variable +' ' Text +'!=' Operator +' ' Text +'"' Literal.String +'HEAD' Literal.String +'"' Literal.String +' ' Text +'&&' Operator +'\n' Text + +' ' Text +'req.method' Name.Variable +' ' Text +'!=' Operator +' ' Text +'"' Literal.String +'PUT' Literal.String +'"' Literal.String +' ' Text +'&&' Operator +'\n' Text + +' ' Text +'req.method' Name.Variable +' ' Text +'!=' Operator +' ' Text +'"' Literal.String +'POST' Literal.String +'"' Literal.String +' ' Text +'&&' Operator +'\n' Text + +' ' Text +'req.method' Name.Variable +' ' Text +'!=' Operator +' ' Text +'"' Literal.String +'TRACE' Literal.String +'"' Literal.String +' ' Text +'&&' Operator +'\n' Text + +' ' Text +'req.method' Name.Variable +' ' Text +'!=' Operator +' ' Text +'"' Literal.String +'OPTIONS' Literal.String +'"' Literal.String +' ' Text +'&&' Operator +'\n' Text + +' ' Text +'req.method' Name.Variable +' ' Text +'!=' Operator +' ' Text +'"' Literal.String +'DELETE' Literal.String +'"' Literal.String +')' Punctuation +' ' Text +'{' Operator +'\n' Text + +' ' Text +'/*' Comment.Multiline +' Non-RFC2616 or CONNECT which is weird. ' Comment.Multiline +'*/' Comment.Multiline +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'pipe' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +' ' Text +'}' Operator +'\n' Text + +'\n' Text + +' ' Text +'if' Keyword +' ' Text +'(' Punctuation +'req.method' Name.Variable +' ' Text +'!=' Operator +' ' Text +'"' Literal.String +'GET' Literal.String +'"' Literal.String +' ' Text +'&&' Operator +' ' Text +'req.method' Name.Variable +' ' Text +'!=' Operator +' ' Text +'"' Literal.String +'HEAD' Literal.String +'"' Literal.String +')' Punctuation +' ' Text +'{' Operator +'\n' Text + +' ' Text +'/*' Comment.Multiline +' We only deal with GET and HEAD by default ' Comment.Multiline +'*/' Comment.Multiline +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'pass' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +' ' Text +'}' Operator +'\n' Text + +' ' Text +'if' Keyword +' ' Text +'(' Punctuation +'req.http.Authorization' Name.Variable +' ' Text +'||' Operator +' ' Text +'req.http.Cookie' Name.Variable +')' Punctuation +' ' Text +'{' Operator +'\n' Text + +' ' Text +'/*' Comment.Multiline +' Not cacheable by default ' Comment.Multiline +'*/' Comment.Multiline +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'pass' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +' ' Text +'}' Operator +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'hash' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_pipe' Name.Function +' {' Punctuation +'\n' Text + +' ' Text +'# By default Connection: close is set on all piped requests, to stop' Comment +'\n' Text + +' ' Text +'# connection reuse from sending future requests directly to the' Comment +'\n' Text + +' ' Text +'# (potentially) wrong backend. If you do want this to happen, you can undo' Comment +'\n' Text + +' ' Text +'# it here.' Comment +'\n' Text + +' ' Text +'# unset bereq.http.connection;' Comment +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'pipe' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_pass' Name.Function +' {' Punctuation +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'fetch' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_hash' Name.Function +' {' Punctuation +'\n' Text + +' ' Text +'hash_data' Keyword +'(' Punctuation +'req.url' Name.Variable +')' Punctuation +';' Punctuation +'\n' Text + +' ' Text +'if' Keyword +' ' Text +'(' Punctuation +'req.http.host' Name.Variable +')' Punctuation +' ' Text +'{' Operator +'\n' Text + +' ' Text +'hash_data' Keyword +'(' Punctuation +'req.http.host' Name.Variable +')' Punctuation +';' Punctuation +'\n' Text + +' ' Text +'}' Operator +' ' Text +'else' Keyword +' ' Text +'{' Operator +'\n' Text + +' ' Text +'hash_data' Keyword +'(' Punctuation +'server.ip' Name.Variable +')' Punctuation +';' Punctuation +'\n' Text + +' ' Text +'}' Operator +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'lookup' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_purge' Name.Function +' {' Punctuation +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'synth' Name.Constant +'(' Punctuation +'200' Literal.Number +',' Operator +' ' Text +'"' Literal.String +'Purged' Literal.String +'"' Literal.String +')' Punctuation +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_hit' Name.Function +' {' Punctuation +'\n' Text + +' ' Text +'if' Keyword +' ' Text +'(' Punctuation +'obj.ttl' Name.Variable +' ' Text +'>=' Operator +' ' Text +'0s' Literal.Date +')' Punctuation +' ' Text +'{' Operator +'\n' Text + +' ' Text +'// A pure unadultered hit, deliver it' Comment +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'deliver' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +' ' Text +'}' Operator +'\n' Text + +' ' Text +'if' Keyword +' ' Text +'(' Punctuation +'obj.ttl' Name.Variable +' ' Text +'+' Operator +' ' Text +'obj.grace' Name.Variable +' ' Text +'>' Operator +' ' Text +'0s' Literal.Date +')' Punctuation +' ' Text +'{' Operator +'\n' Text + +' ' Text +'// Object is in grace, deliver it' Comment +'\n' Text + +' ' Text +'// Automatically triggers a background fetch' Comment +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'deliver' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +' ' Text +'}' Operator +'\n' Text + +' ' Text +'// fetch & deliver once we get the result' Comment +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'miss' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_miss' Name.Function +' {' Punctuation +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'fetch' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_deliver' Name.Function +' {' Punctuation +'\n' Text + +' ' Text +'set' Keyword +' ' Text +'resp.http.x-storage' Name.Variable +' ' Text +'=' Operator +' ' Text +'storage.s0.free' Name.Variable +';' Punctuation +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'deliver' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'/*' Comment.Multiline +'\n ' Comment.Multiline +'*' Comment.Multiline +' We can come here "invisibly" with the following errors: 413, 417 & 503\n ' Comment.Multiline +'*/' Comment.Multiline +'\n' Text + +'sub ' Keyword +'vcl_synth' Name.Function +' {' Punctuation +'\n' Text + +' ' Text +'set' Keyword +' ' Text +'resp.http.Content-Type' Name.Variable +' ' Text +'=' Operator +' ' Text +'"' Literal.String +'text/html; charset=utf-8' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +' ' Text +'set' Keyword +' ' Text +'resp.http.Retry-After' Name.Variable +' ' Text +'=' Operator +' ' Text +'"' Literal.String +'5' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +' ' Text +'synthetic' Keyword +'(' Punctuation +' ' Text +'{"' Literal.String +'<' Literal.String +'!' Literal.String +'D' Literal.String +'O' Literal.String +'C' Literal.String +'T' Literal.String +'Y' Literal.String +'P' Literal.String +'E' Literal.String +' ' Literal.String +'h' Literal.String +'t' Literal.String +'m' Literal.String +'l' Literal.String +'>' Literal.String +'\n' Literal.String + +'<' Literal.String +'h' Literal.String +'t' Literal.String +'m' Literal.String +'l' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +'<' Literal.String +'h' Literal.String +'e' Literal.String +'a' Literal.String +'d' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'t' Literal.String +'i' Literal.String +'t' Literal.String +'l' Literal.String +'e' Literal.String +'>' Literal.String +'"}' Literal.String +' ' Text +'+' Operator +' ' Text +'resp.status' Name.Variable +' ' Text +'+' Operator +' ' Text +'"' Literal.String +' ' Literal.String +'"' Literal.String +' ' Text +'+' Operator +' ' Text +'resp.reason' Name.Variable +' ' Text +'+' Operator +' ' Text +'{"' Literal.String +'<' Literal.String +'/' Literal.String +'t' Literal.String +'i' Literal.String +'t' Literal.String +'l' Literal.String +'e' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +'<' Literal.String +'/' Literal.String +'h' Literal.String +'e' Literal.String +'a' Literal.String +'d' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +'<' Literal.String +'b' Literal.String +'o' Literal.String +'d' Literal.String +'y' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'h' Literal.String +'1' Literal.String +'>' Literal.String +'E' Literal.String +'r' Literal.String +'r' Literal.String +'o' Literal.String +'r' Literal.String +' ' Literal.String +'"}' Literal.String +' ' Text +'+' Operator +' ' Text +'resp.status' Name.Variable +' ' Text +'+' Operator +' ' Text +'"' Literal.String +' ' Literal.String +'"' Literal.String +' ' Text +'+' Operator +' ' Text +'resp.reason' Name.Variable +' ' Text +'+' Operator +' ' Text +'{"' Literal.String +'<' Literal.String +'/' Literal.String +'h' Literal.String +'1' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'p' Literal.String +'>' Literal.String +'"}' Literal.String +' ' Text +'+' Operator +' ' Text +'resp.reason' Name.Variable +' ' Text +'+' Operator +' ' Text +'{"' Literal.String +'<' Literal.String +'/' Literal.String +'p' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'h' Literal.String +'3' Literal.String +'>' Literal.String +'G' Literal.String +'u' Literal.String +'r' Literal.String +'u' Literal.String +' ' Literal.String +'M' Literal.String +'e' Literal.String +'d' Literal.String +'i' Literal.String +'t' Literal.String +'a' Literal.String +'t' Literal.String +'i' Literal.String +'o' Literal.String +'n' Literal.String +':' Literal.String +'<' Literal.String +'/' Literal.String +'h' Literal.String +'3' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'p' Literal.String +'>' Literal.String +'X' Literal.String +'I' Literal.String +'D' Literal.String +':' Literal.String +' ' Literal.String +'"}' Literal.String +' ' Text +'+' Operator +' ' Text +'req.xid' Name.Variable +' ' Text +'+' Operator +' ' Text +'{"' Literal.String +'<' Literal.String +'/' Literal.String +'p' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'h' Literal.String +'r' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'p' Literal.String +'>' Literal.String +'V' Literal.String +'a' Literal.String +'r' Literal.String +'n' Literal.String +'i' Literal.String +'s' Literal.String +'h' Literal.String +' ' Literal.String +'c' Literal.String +'a' Literal.String +'c' Literal.String +'h' Literal.String +'e' Literal.String +' ' Literal.String +'s' Literal.String +'e' Literal.String +'r' Literal.String +'v' Literal.String +'e' Literal.String +'r' Literal.String +'<' Literal.String +'/' Literal.String +'p' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +'<' Literal.String +'/' Literal.String +'b' Literal.String +'o' Literal.String +'d' Literal.String +'y' Literal.String +'>' Literal.String +'\n' Literal.String + +'<' Literal.String +'/' Literal.String +'h' Literal.String +'t' Literal.String +'m' Literal.String +'l' Literal.String +'>' Literal.String +'\n' Literal.String + +'"}' Literal.String +' ' Text +')' Punctuation +';' Punctuation +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'deliver' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'#######################################################################' Comment +'\n' Text + +'# Backend Fetch' Comment +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_backend_fetch' Name.Function +' {' Punctuation +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'fetch' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_backend_response' Name.Function +' {' Punctuation +'\n' Text + +' ' Text +'if' Keyword +' ' Text +'(' Punctuation +'beresp.ttl' Name.Variable +' ' Text +'<=' Operator +' ' Text +'0s' Literal.Date +' ' Text +'||' Operator +'\n' Text + +' ' Text +'beresp.http.Set-Cookie' Name.Variable +' ' Text +'||' Operator +'\n' Text + +' ' Text +'beresp.http.Surrogate-control' Name.Variable +' ' Text +'~' Operator +' ' Text +'"' Literal.String +'no-store' Literal.String +'"' Literal.String +' ' Text +'||' Operator +'\n' Text + +' ' Text +'(' Punctuation +'!' Operator +'beresp.http.Surrogate-Control' Name.Variable +' ' Text +'&&' Operator +'\n' Text + +' ' Text +'beresp.http.Cache-Control' Name.Variable +' ' Text +'~' Operator +' ' Text +'"' Literal.String +'no-cache|no-store|private' Literal.String +'"' Literal.String +')' Punctuation +' ' Text +'||' Operator +'\n' Text + +' ' Text +'beresp.http.Vary' Name.Variable +' ' Text +'==' Operator +' ' Text +'"' Literal.String +'*' Literal.String +'"' Literal.String +')' Punctuation +' ' Text +'{' Operator +'\n' Text + +' ' Text +'/*' Comment.Multiline +'\n ' Comment.Multiline +'*' Comment.Multiline +' Mark as "Hit-For-Pass" for the next 2 minutes\n ' Comment.Multiline +'*/' Comment.Multiline +'\n' Text + +' ' Text +'set' Keyword +' ' Text +'beresp.ttl' Name.Variable +' ' Text +'=' Operator +' ' Text +'120s' Literal.Date +';' Punctuation +'\n' Text + +' ' Text +'set' Keyword +' ' Text +'beresp.uncacheable' Name.Variable +' ' Text +'=' Operator +' ' Text +'true' Name.Builtin +';' Punctuation +'\n' Text + +' ' Text +'}' Operator +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'deliver' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_backend_error' Name.Function +' {' Punctuation +'\n' Text + +' ' Text +'set' Keyword +' ' Text +'beresp.http.Content-Type' Name.Variable +' ' Text +'=' Operator +' ' Text +'"' Literal.String +'text/html; charset=utf-8' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +' ' Text +'set' Keyword +' ' Text +'beresp.http.Retry-After' Name.Variable +' ' Text +'=' Operator +' ' Text +'"' Literal.String +'5' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +' ' Text +'synthetic' Keyword +'(' Punctuation +' ' Text +'{"' Literal.String +'<' Literal.String +'!' Literal.String +'D' Literal.String +'O' Literal.String +'C' Literal.String +'T' Literal.String +'Y' Literal.String +'P' Literal.String +'E' Literal.String +' ' Literal.String +'h' Literal.String +'t' Literal.String +'m' Literal.String +'l' Literal.String +'>' Literal.String +'\n' Literal.String + +'<' Literal.String +'h' Literal.String +'t' Literal.String +'m' Literal.String +'l' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +'<' Literal.String +'h' Literal.String +'e' Literal.String +'a' Literal.String +'d' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'t' Literal.String +'i' Literal.String +'t' Literal.String +'l' Literal.String +'e' Literal.String +'>' Literal.String +'"}' Literal.String +' ' Text +'+' Operator +' ' Text +'beresp.status' Name.Variable +' ' Text +'+' Operator +' ' Text +'"' Literal.String +' ' Literal.String +'"' Literal.String +' ' Text +'+' Operator +' ' Text +'beresp.reason' Name.Variable +' ' Text +'+' Operator +' ' Text +'{"' Literal.String +'<' Literal.String +'/' Literal.String +'t' Literal.String +'i' Literal.String +'t' Literal.String +'l' Literal.String +'e' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +'<' Literal.String +'/' Literal.String +'h' Literal.String +'e' Literal.String +'a' Literal.String +'d' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +'<' Literal.String +'b' Literal.String +'o' Literal.String +'d' Literal.String +'y' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'h' Literal.String +'1' Literal.String +'>' Literal.String +'E' Literal.String +'r' Literal.String +'r' Literal.String +'o' Literal.String +'r' Literal.String +' ' Literal.String +'"}' Literal.String +' ' Text +'+' Operator +' ' Text +'beresp.status' Name.Variable +' ' Text +'+' Operator +' ' Text +'"' Literal.String +' ' Literal.String +'"' Literal.String +' ' Text +'+' Operator +' ' Text +'beresp.reason' Name.Variable +' ' Text +'+' Operator +' ' Text +'{"' Literal.String +'<' Literal.String +'/' Literal.String +'h' Literal.String +'1' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'p' Literal.String +'>' Literal.String +'"}' Literal.String +' ' Text +'+' Operator +' ' Text +'beresp.reason' Name.Variable +' ' Text +'+' Operator +' ' Text +'{"' Literal.String +'<' Literal.String +'/' Literal.String +'p' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'h' Literal.String +'3' Literal.String +'>' Literal.String +'G' Literal.String +'u' Literal.String +'r' Literal.String +'u' Literal.String +' ' Literal.String +'M' Literal.String +'e' Literal.String +'d' Literal.String +'i' Literal.String +'t' Literal.String +'a' Literal.String +'t' Literal.String +'i' Literal.String +'o' Literal.String +'n' Literal.String +':' Literal.String +'<' Literal.String +'/' Literal.String +'h' Literal.String +'3' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'p' Literal.String +'>' Literal.String +'X' Literal.String +'I' Literal.String +'D' Literal.String +':' Literal.String +' ' Literal.String +'"}' Literal.String +' ' Text +'+' Operator +' ' Text +'bereq.xid' Name.Variable +' ' Text +'+' Operator +' ' Text +'{"' Literal.String +'<' Literal.String +'/' Literal.String +'p' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'h' Literal.String +'r' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +' ' Literal.String +' ' Literal.String +'<' Literal.String +'p' Literal.String +'>' Literal.String +'V' Literal.String +'a' Literal.String +'r' Literal.String +'n' Literal.String +'i' Literal.String +'s' Literal.String +'h' Literal.String +' ' Literal.String +'c' Literal.String +'a' Literal.String +'c' Literal.String +'h' Literal.String +'e' Literal.String +' ' Literal.String +'s' Literal.String +'e' Literal.String +'r' Literal.String +'v' Literal.String +'e' Literal.String +'r' Literal.String +'<' Literal.String +'/' Literal.String +'p' Literal.String +'>' Literal.String +'\n' Literal.String + +' ' Literal.String +' ' Literal.String +'<' Literal.String +'/' Literal.String +'b' Literal.String +'o' Literal.String +'d' Literal.String +'y' Literal.String +'>' Literal.String +'\n' Literal.String + +'<' Literal.String +'/' Literal.String +'h' Literal.String +'t' Literal.String +'m' Literal.String +'l' Literal.String +'>' Literal.String +'\n' Literal.String + +'"}' Literal.String +' ' Text +')' Punctuation +';' Punctuation +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'deliver' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'#######################################################################' Comment +'\n' Text + +'# Housekeeping' Comment +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_init' Name.Function +' {' Punctuation +'\n' Text + +'}' Operator +'\n' Text + +'\n' Text + +'sub ' Keyword +'vcl_fini' Name.Function +' {' Punctuation +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'(' Punctuation +'ok' Name.Constant +')' Punctuation +';' Punctuation +'\n' Text + +'}' Operator +'\n' Text |
