Remove keep-alive from http2 to http1.1 proxies, tweak seedbox caching and keep if-modified-since headers, ignore cookies when they are not session cookies
This commit is contained in:
parent
d7170d407e
commit
fee4131da3
@ -28,7 +28,7 @@ sub vcl_recv {
|
||||
sub vcl_hash {
|
||||
hash_data(req.url);
|
||||
hash_data(req.http.host);
|
||||
if (req.http.cookie) {
|
||||
if (req.http.cookie ~ "pleroma_key|gitea_incredible|grafana_session") {
|
||||
hash_data(req.http.cookie);
|
||||
}
|
||||
if (req.http.authorization) {
|
||||
@ -38,13 +38,24 @@ sub vcl_hash {
|
||||
}
|
||||
sub vcl_backend_response {
|
||||
set beresp.do_stream = false;
|
||||
if ( beresp.http.Set-Cookie ||
|
||||
beresp.http.Cache-Control ~ "no-cache|no-store|private") {
|
||||
set beresp.uncacheable = true;
|
||||
return(deliver);
|
||||
if (beresp.http.Set-Cookie || beresp.http.Cache-Control ~ "no-cache|no-store|private") {
|
||||
set beresp.uncacheable = true;
|
||||
return(deliver);
|
||||
}
|
||||
if (beresp.http.Cache-Control ~ "no-cache") {
|
||||
set beresp.ttl = 10m;
|
||||
set beresp.grace = 5m;
|
||||
return (deliver);
|
||||
}
|
||||
if (bereq.http.Host ~ "sd.redxen.eu") {
|
||||
set beresp.ttl = 120s;
|
||||
set beresp.keep = 7d;
|
||||
set beresp.do_gzip = true;
|
||||
set beresp.grace = 2h;
|
||||
return (deliver);
|
||||
}
|
||||
set beresp.grace = 5m;
|
||||
if (beresp.http.ETag || beresp.http.Last-Modified) {
|
||||
if (beresp.http.ETag || beresp.http.Last-Modified || bereq.http.If-Modified-Since) {
|
||||
set beresp.keep = 4h;
|
||||
}
|
||||
if (beresp.status == 301) {
|
||||
@ -65,6 +76,9 @@ sub vcl_backend_response {
|
||||
return (deliver);
|
||||
}
|
||||
sub vcl_deliver {
|
||||
if (req.proto ~ "HTTP/2.0" && resp.http.keep-alive) {
|
||||
unset resp.http.keep-alive;
|
||||
}
|
||||
if (obj.hits > 0) {
|
||||
set resp.http.X-Cache = "HIT";
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user