normalize the header

Vitaly Burshteyn vburshteyn at broadway.com
Tue Nov 30 19:50:10 CET 2010


Hi folks,

 So it seems as if the cache is working and i am getting cache hits.
When i shut down the back end i can still get to the cached pages.

On the other hand when i try a new browser i keep getting 503 pages.

 

I included part of my VCL code.  I try to normalize my headers but I am
missing something.

 

 

sub vcl_hash {

    set req.hash += req.http.cookie;

    set req.hash += req.http.set-cookie;

    }

 

 

########################################################################
##############################

sub vcl_recv {

    set req.backend = bw;  #backend information

 

 

    unset req.http.cookie;

 

    #redirect /admin to 404

    if (req.url ~ "^/admin/"){ set req.url = regsub(req.url, "^/admin/",
"/oops/");    }

 

    # Never cache this path

    if (req.url ~ "/affiliates/visa-signature/") {   return(pass);
}

    if (req.url ~ "/r/") { return(pass);    }

 

    if (req.http.cookie) {

        set req.http.cookie = regsuball(req.http.Cookie,
"(^|;\s*)(_[_a-z]+|has_js)=[^;]*", "");

        set req.http.cookie = regsub(req.http.Cookie, "^;\s*", "");    }

 

    if (req.http.Accept-Encoding) {

 

    if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") {

        # No point in compressing these

        remove req.http.Accept-Encoding;

    } elsif (req.http.Accept-Encoding ~ "gzip") {

        set req.http.Accept-Encoding = "gzip";

    } elsif (req.http.Accept-Encoding ~ "deflate") {

        set req.http.Accept-Encoding = "deflate";

    } else {

        # unkown algorithm

        remove req.http.Accept-Encoding;  }

}

   return(lookup);}

 

Vitaly Burshteyn

Senior Network Engineer

Broadway.com, Theatre Direct International

729  7th Avenue

New York, New York 10019

Phone: 212.817.9117

Cell# 917-701-5732

 


____________________________________
The information contained in this transmission may contain privileged 
and confidential information.  It is intended only for the use of the 
person(s) named above. If you are not the intended recipient,  you are 
hereby notified that any review, dissemination, distribution or 
duplication of this communication is strictly prohibited. If you are 
not the intended recipient, please contact the sender by reply email 
and destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20101130/9a611337/attachment-0003.html>


More information about the varnish-misc mailing list