• Poul-Henning Kamp's avatar
    Add the first stab at a "restart" mechanism. · 1c8e6642
    Poul-Henning Kamp authored
    The intent is to be able to do things like:
    
    	backend b1 {
    		set backend.host = "fs.freebsd.dk";
    		set backend.port = "82";
    	}
    	backend b2 {
    		set backend.host = "fs.freebsd.dk";
    		set backend.port = "81";
    	}
    	backend b3 {
    		set backend.host = "fs.freebsd.dk";
    		set backend.port = "80";
    	}
    
    	sub vcl_recv {
    		remove req.http.cookie;
    		if (req.restarts == 0) {
    			set req.backend = b1;
    		} else if (req.restarts == 1) {
    			set req.backend = b2;
    		} else {
    			set req.backend = b3;
    		}
    	}
    
    	sub vcl_fetch {
    		if (obj.status != 200) {
    			restart;
    		}
    	}
    
    
    
    
    git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2067 d4fa192b-c00b-0410-8231-f00ffab90ce4
    1c8e6642
cache.h 16.4 KB