vcl file for caching flash video?

Kang Liu cnkang at gmail.com
Thu Mar 29 07:06:41 CEST 2007


Hi,
I'm testing varnish for caching flash video content for a youtube
style site. I wrote a very simple vcl file for the site.
the backend is lighttpd, contents in the backend are all flash videos
(.flv files).
Is there any problem in my vcl file?

backend default {
    set backend.host = "IP address";
    set backend.port = "http";
}

sub vcl_recv {
    if (req.request != "GET" && req.request != "HEAD") {
        pipe;
    }
    if (req.http.Expect) {
        pipe;
    }
    lookup;
}//no cookie, no auth needed; just look up the cache...

sub vcl_hit {
    deliver;
}//deliver each hit from cache

sub vcl_miss {
    fetch;
}

sub vcl_fetch {
    if (!obj.valid) {
        error;
    }
    set obj.ttl = 31536000s;
    insert;
}//flash video never change, so cache everything for 1 year

sub vcl_timeout {
    discard;
}



More information about the varnish-misc mailing list