Commit a4d1d5d2 authored by Lasse Karstensen's avatar Lasse Karstensen

Small example on how to do synthetic responses

parent 793d67ad
......@@ -41,6 +41,24 @@ You must now explicitly return an error::
return(error(999, "Response));
Synthetic responses in vcl_error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Setting headers on synthetic response bodies made in vcl_error are now done on
resp.http instead of obj.http.
The synthetic keyword is now a function::
if (resp.status == 799) {
set resp.status = 200;
set resp.http.Content-Type = "text/plain; charset=utf-8";
synthetic({"You are "} + client.ip);
return (deliver);
}
hit_for_pass objects are created using beresp.uncacheable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Example::
......
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