Commit 95dfe7f0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add VCL design pattern about resp.status and modulus operator.

parent 6d15fe03
.. _dp_vcl_resp_status:
Using extra digits in resp.status
=================================
In Varnish the ``.status`` variables can hold more than three
digits, which is useful to send information to ``vcl_synth{}``
about which error message to produce::
sub vcl_recv {
if ([...]) {
return(synth(12404));
}
}
sub vcl_synth {
if (resp.status == 12404) {
[...] // this specific 404
} else if (resp.status % 1000 == 404) {
[...] // all other 404's
}
}
......@@ -23,6 +23,7 @@ VCL Design Patterns
:maxdepth: 1
dp_vcl_recv_hash.rst
dp_vcl_resp_status.rst
Bundled VMODs
-------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment