• Nils Goroll's avatar
    vcl_deliver read-only access to obj.ttl, obj.age, obj.grace and obj.keep · 9095c5cf
    Nils Goroll authored
    Noticed that I've been missing this since the beginning of time when
    porting some ancient inline-C.
    
    We already have obj.uncacheable und obj.hits in vcl_deliver, so not
    having these seems arbitrary. Copying out the values in vcl_hit just
    to have them available in vcl_deliver, as it was possible previously,
    implies unnecessary overhead.
    
    One use case is to extend object lifetime downstream when delivering a
    stale object, e.g.
    
    sub vcl_deliver {
        if (! obj.uncacheable && obj.ttl < 0s) {
    	set resp.http.Expires = now + 1m;
    	set resp.http.Cache-Control = "public, max-age=60";
    	unset req.http.Age;
        }
    }
    
    merges #2057
    9095c5cf
generate.py 27.8 KB