31 lines
492 B
Plaintext
31 lines
492 B
Plaintext
vcl 4.1;
|
|
|
|
backend default {
|
|
.host = "${backend_host}";
|
|
.port = "${backend_port}";
|
|
}
|
|
|
|
sub vcl_recv {
|
|
if (req.url == "/" || req.url == "/health") {
|
|
return (pass);
|
|
}
|
|
|
|
if (req.method != "GET" && req.method != "HEAD") {
|
|
return (pass);
|
|
}
|
|
|
|
return (hash);
|
|
}
|
|
|
|
sub vcl_backend_response {
|
|
set beresp.ttl = 1h;
|
|
}
|
|
|
|
sub vcl_deliver {
|
|
if (obj.hits > 0) {
|
|
set resp.http.X-Cache = "HIT";
|
|
} else {
|
|
set resp.http.X-Cache = "MISS";
|
|
}
|
|
}
|