Skip to content
Snippets Groups Projects
Commit bbb80d17 authored by skorpy's avatar skorpy :construction_worker:
Browse files

grafana/varnish: update config

parent 959852dd
No related branches found
No related tags found
No related merge requests found
Pipeline #28402 passed
......@@ -103,29 +103,36 @@ sub vcl_backend_response {
# and other mistakes your backend does.
unset beresp.http.Set-Cookie;
unset beresp.http.Cookie;
unset beresp.http.pragma;
unset beresp.http.cache-control;
unset beresp.http.Pragma;
unset beresp.http.Cache-Control;
unset beresp.http.Expires;
unset beresp.http.Vary;
# set beresp.ttl = 120s;
set beresp.ttl = 600s;
unset beresp.http.Last-Modified;
unset beresp.http.ETag;
unset beresp.http.expires;
set beresp.http.cache-control = "max-age=120";
set beresp.ttl = 10s;
if(beresp.status == 200) {
set beresp.ttl = 600s;
}
}
sub vcl_deliver {
# Happens when we have all the pieces we need, and are about to send the
# response to the client.
#
# You can do accounting or modifying the final object here.
/*
* generic synthetic handler
*/
set resp.http.Date = now;
unset resp.http.via;
unset resp.http.x-varnish;
unset resp.http.Server;
unset resp.http.X-Varnish;
unset resp.http.Date;
unset resp.http.Via;
unset resp.http.Age;
set resp.http.Vary = "Accept-Encoding";
set resp.http.Server = "nginx";
set resp.http.Date = now;
set resp.http.Cache-Control = "max-age=120";
set resp.http.Expires = "" + (now + (std.duration("120s", 120s)));
set resp.http.grace = req.http.grace;
# could be useful to know if the object was in cache or not
if (obj.hits > 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment