<div dir="ltr">please unsubscribe, thank you</div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-04 15:10 GMT+02:00 <span dir="ltr"><<a href="mailto:varnish-misc-request@varnish-cache.org" target="_blank">varnish-misc-request@varnish-cache.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send varnish-misc mailing list submissions to<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/<wbr>varnish-misc</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:varnish-misc-request@varnish-cache.org">varnish-misc-request@varnish-<wbr>cache.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:varnish-misc-owner@varnish-cache.org">varnish-misc-owner@varnish-<wbr>cache.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of varnish-misc digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: XenForo default.vcl settings (Ayberk Kimsesiz)<br>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>----------<br>
<br>
Message: 1<br>
Date: Thu, 4 Aug 2016 16:09:43 +0300<br>
From: Ayberk Kimsesiz <<a href="mailto:ayberk.kimsesiz@gmail.com">ayberk.kimsesiz@gmail.com</a>><br>
To: "Lane, Richard" <<a href="mailto:rlane@ahbelo.com">rlane@ahbelo.com</a>><br>
Cc: varnish-misc <<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.<wbr>org</a>><br>
Subject: Re: XenForo default.vcl settings<br>
Message-ID:<br>
<<a href="mailto:CAPQGzE0fSRhOyXOgHQJNXJdev_SECO6fi5085UDuPdcOen4fAQ@mail.gmail.com">CAPQGzE0fSRhOyXOgHQJNXJdev_<wbr>SECO6fi5085UDuPdcOen4fAQ@mail.<wbr>gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Users can't login or register to <a href="http://domain.com/forum" rel="noreferrer" target="_blank">domain.com/forum</a> with the current<br>
settings. So we need to make a change related to *xf_user *and *xf_session*<br>
but how?<br>
<br>
<br>
<br>
2016-08-04 15:26 GMT+03:00 Lane, Richard <<a href="mailto:rlane@ahbelo.com">rlane@ahbelo.com</a>>:<br>
<br>
> If you want Varnish to ignore request for a path you need to tell it to<br>
> pass. In your example you have a rule for the RSS feed. You can do the same<br>
> for /forum/ in your vcl_recv block.<br>
><br>
> *# DO NOT CACHE RSS FEED*<br>
> * if (req.url ~ "/feed(/)?") {*<br>
> * return ( pass ); *<br>
> *}*<br>
><br>
> *# DO NOT CACHE FORUM*<br>
> if (req.url ~ "/forum(/)?") {<br>
> return ( pass );<br>
> }<br>
><br>
> Cheers,<br>
> Richard<br>
><br>
><br>
>><br>
>> Message: 1<br>
>> Date: Wed, 3 Aug 2016 23:34:40 +0300<br>
>> From: Ayberk Kimsesiz <<a href="mailto:ayberk.kimsesiz@gmail.com">ayberk.kimsesiz@gmail.com</a>><br>
>> To: varnish-misc <<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.<wbr>org</a>><br>
>> Subject: XenForo default.vcl settings<br>
>> Message-ID:<br>
>> <CAPQGzE29n1QOmHarn9L-<wbr>9ztquGfeu-AwNJUaDrHm_w-5BXmA_<wbr>Q@mail.<br>
>> <a href="http://gmail.com" rel="noreferrer" target="_blank">gmail.com</a>><br>
>> Content-Type: text/plain; charset="utf-8"<br>
>><br>
>> Hi,<br>
>><br>
>> Could you please share the appropriate Default.vcl settings for XenForo<br>
>> Forums? No one can register to the forum at the moment. My current<br>
>> Default.vcl settings are as follows.<br>
>><br>
>> Forum address: <a href="http://domain.com/forum" rel="noreferrer" target="_blank">domain.com/forum</a><br>
>><br>
>> */* SET THE HOST AND PORT OF WORDPRESS*<br>
>> * * ******************************<wbr>***************************/*<br>
>> *vcl 4.0;*<br>
>> *import std;*<br>
>><br>
>> *backend default {*<br>
>> * .host = "*******";*<br>
>> * .port = "8080";*<br>
>> * .connect_timeout = 600s;*<br>
>> * .first_byte_timeout = 600s;*<br>
>> * .between_bytes_timeout = 600s;*<br>
>> * .max_connections = 800;*<br>
>> *}*<br>
>><br>
>> *# SET THE ALLOWED IP OF PURGE REQUESTS*<br>
>> *# ##############################<wbr>############################*<br>
>> *acl purge {*<br>
>> * "localhost";*<br>
>> * "127.0.0.1";*<br>
>> *}*<br>
>><br>
>> *#THE RECV FUNCTION*<br>
>> *# ##############################<wbr>############################*<br>
>> *sub vcl_recv {*<br>
>><br>
>> *# set realIP by trimming CloudFlare IP which will be used for various<br>
>> checks*<br>
>> *set req.http.X-Actual-IP = regsub(req.http.X-Forwarded-<wbr>For, "[, ].*$",<br>
>> ""); *<br>
>><br>
>> * # FORWARD THE IP OF THE REQUEST*<br>
>> * if (req.restarts == 0) {*<br>
>> * if (req.http.x-forwarded-for) {*<br>
>> * set req.http.X-Forwarded-For =*<br>
>> * req.http.X-Forwarded-For + ", " + client.ip;*<br>
>> * } else {*<br>
>> * set req.http.X-Forwarded-For = client.ip;*<br>
>> * }*<br>
>> * }*<br>
>><br>
>> * # Purge request check sections for hash_always_miss, purge and ban*<br>
>> * # BLOCK IF NOT IP is not in purge acl*<br>
>> * # ##############################<wbr>############################*<br>
>><br>
>> * # Enable smart refreshing using hash_always_miss*<br>
>> *if (req.http.Cache-Control ~ "no-cache") {*<br>
>> * if (client.ip ~ purge || !std.ip(req.http.X-Actual-IP, "1.2.3.4") ~<br>
>> purge) {*<br>
>> * set req.hash_always_miss = true;*<br>
>> * }*<br>
>> *}*<br>
>><br>
>> *if (req.method == "PURGE") {*<br>
>> * if (!client.ip ~ purge || !std.ip(req.http.X-Actual-IP, "1.2.3.4") ~<br>
>> purge) {*<br>
>> * return(synth(405,"Not allowed."));*<br>
>> * }*<br>
>> * return (purge);*<br>
>><br>
>> * }*<br>
>> *if (req.method == "BAN") {*<br>
>> * # Same ACL check as above:*<br>
>> * if (!client.ip ~ purge || !std.ip(req.http.X-Actual-IP,<br>
>> "1.2.3.4")<br>
>> ~ purge) {*<br>
>> * return(synth(403, "Not allowed."));*<br>
>> * }*<br>
>> * ban("req.http.host == " + req.http.host +*<br>
>> * " && req.url == " + req.url);*<br>
>><br>
>> * # Throw a synthetic page so the*<br>
>> * # request won't go to the backend.*<br>
>> * return(synth(200, "Ban added"));*<br>
>> *}*<br>
>><br>
>><br>
>> *# Unset cloudflare cookies*<br>
>> *# Remove has_js and CloudFlare/Google Analytics __* cookies.*<br>
>> * set req.http.Cookie = regsuball(req.http.Cookie,<br>
>> "(^|;\s*)(_[_a-z]+|has_js)=[^;<wbr>]*", "");*<br>
>> * # Remove a ";" prefix, if present.*<br>
>> * set req.http.Cookie = regsub(req.http.Cookie, "^;\s*", "");*<br>
>><br>
>> * # For Testing: If you want to test with Varnish passing (not caching)<br>
>> uncomment*<br>
>> * # return( pass );*<br>
>><br>
>> * # FORWARD THE IP OF THE REQUEST*<br>
>> * if (req.restarts == 0) {*<br>
>> * if (req.http.x-forwarded-for) {*<br>
>> * set req.http.X-Forwarded-For =*<br>
>> * req.http.X-Forwarded-For + ", " + client.ip;*<br>
>> * } else {*<br>
>> * set req.http.X-Forwarded-For = client.ip;*<br>
>> * }*<br>
>> * }*<br>
>><br>
>> *# DO NOT CACHE RSS FEED*<br>
>> * if (req.url ~ "/feed(/)?") {*<br>
>> * return ( pass ); *<br>
>> *}*<br>
>><br>
>> *## Do not cache search results, comment these 3 lines if you do want to<br>
>> cache them*<br>
>><br>
>> *if (req.url ~ "/\?s\=") {*<br>
>> * return ( pass ); *<br>
>> *}*<br>
>><br>
>> *# CLEAN UP THE ENCODING HEADER.*<br>
>> * # SET TO GZIP, DEFLATE, OR REMOVE ENTIRELY. WITH VARY ACCEPT-ENCODING*<br>
>> * # VARNISH WILL CREATE SEPARATE CACHES FOR EACH*<br>
>> * # DO NOT ACCEPT-ENCODING IMAGES, ZIPPED FILES, AUDIO, ETC.*<br>
>> * # ##############################<wbr>############################*<br>
>> * if (req.http.Accept-Encoding) {*<br>
>> * if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|<wbr>tbz|mp3|ogg)$") {*<br>
>> * # No point in compressing these*<br>
>> * unset req.http.Accept-Encoding;*<br>
>> * } elsif (req.http.Accept-Encoding ~ "gzip") {*<br>
>> * set req.http.Accept-Encoding = "gzip";*<br>
>> * } elsif (req.http.Accept-Encoding ~ "deflate") {*<br>
>> * set req.http.Accept-Encoding = "deflate";*<br>
>> * } else {*<br>
>> * # unknown algorithm*<br>
>> * unset req.http.Accept-Encoding;*<br>
>> * }*<br>
>> * }*<br>
>><br>
>> * # PIPE ALL NON-STANDARD REQUESTS*<br>
>> * # ##############################<wbr>############################*<br>
>> * if (req.method != "GET" &&*<br>
>> * req.method != "HEAD" &&*<br>
>> * req.method != "PUT" && *<br>
>> * req.method != "POST" &&*<br>
>> * req.method != "TRACE" &&*<br>
>> * req.method != "OPTIONS" &&*<br>
>> * req.method != "DELETE") {*<br>
>> * return (pipe);*<br>
>> * }*<br>
>><br>
>> * # ONLY CACHE GET AND HEAD REQUESTS*<br>
>> * # ##############################<wbr>############################*<br>
>> * if (req.method != "GET" && req.method != "HEAD") {*<br>
>> * return (pass);*<br>
>> * }*<br>
>><br>
>> * # OPTIONAL: DO NOT CACHE LOGGED IN USERS (THIS OCCURS IN FETCH TOO,<br>
>> EITHER*<br>
>> * # COMMENT OR UNCOMMENT BOTH*<br>
>> * # ##############################<wbr>############################*<br>
>> * if ( req.http.cookie ~ "wordpress_logged_in" ) {*<br>
>> * return( pass );*<br>
>> * }*<br>
>><br>
>> * # IF THE REQUEST IS NOT FOR A PREVIEW, WP-ADMIN OR WP-LOGIN*<br>
>> * # THEN UNSET THE COOKIES*<br>
>> * # ##############################<wbr>############################*<br>
>> * if (!(req.url ~ "wp-(login|admin)") *<br>
>> * && !(req.url ~ "&preview=true" ) *<br>
>> * ){*<br>
>> * unset req.http.cookie;*<br>
>> * }*<br>
>><br>
>> * # IF BASIC AUTH IS ON THEN DO NOT CACHE*<br>
>> * # ##############################<wbr>############################*<br>
>> * if (req.http.Authorization || req.http.Cookie) {*<br>
>> * return (pass);*<br>
>> * }*<br>
>><br>
>> * # IF YOU GET HERE THEN THIS REQUEST SHOULD BE CACHED*<br>
>> * # ##############################<wbr>############################*<br>
>> * return (hash);*<br>
>> * # This is for phpmyadmin*<br>
>> *if (req.http.Host == "<a href="http://ki1.org" rel="noreferrer" target="_blank">ki1.org</a> <<a href="http://ki1.org" rel="noreferrer" target="_blank">http://ki1.org</a>>") {*<br>
>> *return (pass);*<br>
>> *}*<br>
>><br>
>> *if (req.http.Host == "<a href="http://mysql.ki1.org" rel="noreferrer" target="_blank">mysql.ki1.org</a> <<a href="http://mysql.ki1.org" rel="noreferrer" target="_blank">http://mysql.ki1.org</a>>") {*<br>
>> *return (pass);*<br>
>> *}*<br>
>><br>
>> *}*<br>
>><br>
>> *# HIT FUNCTION*<br>
>> *# ##############################<wbr>############################*<br>
>> *sub vcl_hit {*<br>
>> * # IF THIS IS A PURGE REQUEST THEN DO THE PURGE*<br>
>> * # ##############################<wbr>############################*<br>
>> * if (req.method == "PURGE") {*<br>
>> * #*<br>
>> * # This is now handled in vcl_recv.*<br>
>> * #*<br>
>> * # purge;*<br>
>> * return (synth(200, "Purged."));*<br>
>> * }*<br>
>> * return (deliver);*<br>
>> *}*<br>
>><br>
>> *# MISS FUNCTION*<br>
>> *# ##############################<wbr>############################*<br>
>> *sub vcl_miss {*<br>
>> * if (req.method == "PURGE") {*<br>
>> * #*<br>
>> * # This is now handled in vcl_recv.*<br>
>> * #*<br>
>> * # purge;*<br>
>> * return (synth(200, "Purged."));*<br>
>> * }*<br>
>> * return (fetch);*<br>
>> *}*<br>
>><br>
>> *# FETCH FUNCTION*<br>
>> *# ##############################<wbr>############################*<br>
>> *sub vcl_backend_response {*<br>
>> * # I SET THE VARY TO ACCEPT-ENCODING, THIS OVERRIDES W3TC *<br>
>> * # TENDANCY TO SET VARY USER-AGENT. YOU MAY OR MAY NOT WANT*<br>
>> * # TO DO THIS*<br>
>> * # ##############################<wbr>############################*<br>
>> * set beresp.http.Vary = "Accept-Encoding";*<br>
>><br>
>> * # IF NOT WP-ADMIN THEN UNSET COOKIES AND SET THE AMOUNT OF *<br>
>> * # TIME THIS PAGE WILL STAY CACHED (TTL)*<br>
>> * # ##############################<wbr>############################*<br>
>> * if (!(bereq.url ~ "wp-(login|admin)") && !bereq.http.cookie ~<br>
>> "wordpress_logged_in" ) {*<br>
>> * unset beresp.http.set-cookie;*<br>
>> * set beresp.ttl = 52w;*<br>
>> *# set beresp.grace =1w;*<br>
>> * }*<br>
>><br>
>> * if (beresp.ttl <= 0s ||*<br>
>> * beresp.http.Set-Cookie ||*<br>
>> * beresp.http.Vary == "*") {*<br>
>> * set beresp.ttl = 120 s;*<br>
>> * # set beresp.ttl = 120s;*<br>
>> * set beresp.uncacheable = true;*<br>
>> * return (deliver);*<br>
>> * }*<br>
>><br>
>> * return (deliver);*<br>
>> *}*<br>
>><br>
>> *# DELIVER FUNCTION*<br>
>> *# ##############################<wbr>############################*<br>
>> *sub vcl_deliver {*<br>
>> * # IF THIS PAGE IS ALREADY CACHED THEN RETURN A 'HIT' TEXT *<br>
>> * # IN THE HEADER (GREAT FOR DEBUGGING)*<br>
>> * # ##############################<wbr>############################*<br>
>> * if (obj.hits > 0) {*<br>
>> * set resp.http.X-Cache = "HIT";*<br>
>> * # IF THIS IS A MISS RETURN THAT IN THE HEADER*<br>
>> * # ##############################<wbr>############################*<br>
>> * } else {*<br>
>> * set resp.http.X-Cache = "MISS";*<br>
>> * }*<br>
>> *}*<br>
>><br>
>><br>
>> Thanks,<br>
>> -------------- next part --------------<br>
>> An HTML attachment was scrubbed...<br>
>> URL: <<a href="https://www.varnish-cache.org/lists/pipermail/varnish-misc/" rel="noreferrer" target="_blank">https://www.varnish-cache.<wbr>org/lists/pipermail/varnish-<wbr>misc/</a><br>
>> attachments/20160803/d572e4b2/<wbr>attachment-0001.html><br>
>><br>
>> ------------------------------<br>
>><br>
>> Message: 2<br>
>> Date: Thu, 4 Aug 2016 12:14:36 +0300<br>
>> From: Ayberk Kimsesiz <<a href="mailto:ayberk.kimsesiz@gmail.com">ayberk.kimsesiz@gmail.com</a>><br>
>> To: varnish-misc <<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.<wbr>org</a>><br>
>> Subject: Re: XenForo default.vcl settings<br>
>> Message-ID:<br>
>> <CAPQGzE39XkXy_<wbr>44z5oUXBO5q5sF5CvQmNP5k771DPi4<wbr>O3i1ofA@mail.<br>
>> <a href="http://gmail.com" rel="noreferrer" target="_blank">gmail.com</a>><br>
>> Content-Type: text/plain; charset="utf-8"<br>
>><br>
>> I need to add the followings to default.vcl for Xenforo. However,<br>
>> solutions<br>
>> in the Xenforo forums for this didn't work. Can you please help?<br>
>><br>
>> xf_session_admin<br>
>> xf_user<br>
>> xf_session<br>
>><br>
>> Or how can i block Varnish in a way that it doesn't work in *<br>
>> <a href="http://domain.com/forum" rel="noreferrer" target="_blank">domain.com/forum</a><br>
>> <<a href="http://domain.com/forum" rel="noreferrer" target="_blank">http://domain.com/forum</a>>*<br>
>><br>
>><br>
>><br>
>> 2016-08-03 23:34 GMT+03:00 Ayberk Kimsesiz <<a href="mailto:ayberk.kimsesiz@gmail.com">ayberk.kimsesiz@gmail.com</a>>:<br>
>><br>
>> > Hi,<br>
>> ><br>
>> > Could you please share the appropriate Default.vcl settings for XenForo<br>
>> > Forums? No one can register to the forum at the moment. My current<br>
>> > Default.vcl settings are as follows.<br>
>> ><br>
>> > Forum address: <a href="http://domain.com/forum" rel="noreferrer" target="_blank">domain.com/forum</a><br>
>> ><br>
>> > */* SET THE HOST AND PORT OF WORDPRESS*<br>
>> > * * ******************************<wbr>***************************/*<br>
>> > *vcl 4.0;*<br>
>> > *import std;*<br>
>> ><br>
>> > *backend default {*<br>
>> > * .host = "*******";*<br>
>> > * .port = "8080";*<br>
>> > * .connect_timeout = 600s;*<br>
>> > * .first_byte_timeout = 600s;*<br>
>> > * .between_bytes_timeout = 600s;*<br>
>> > * .max_connections = 800;*<br>
>> > *}*<br>
>> ><br>
>> > *# SET THE ALLOWED IP OF PURGE REQUESTS*<br>
>> > *# ##############################<wbr>############################*<br>
>> > *acl purge {*<br>
>> > * "localhost";*<br>
>> > * "127.0.0.1";*<br>
>> > *}*<br>
>> ><br>
>> > *#THE RECV FUNCTION*<br>
>> > *# ##############################<wbr>############################*<br>
>> > *sub vcl_recv {*<br>
>> ><br>
>> > *# set realIP by trimming CloudFlare IP which will be used for various<br>
>> > checks*<br>
>> > *set req.http.X-Actual-IP = regsub(req.http.X-Forwarded-<wbr>For, "[, ].*$",<br>
>> > ""); *<br>
>> ><br>
>> > * # FORWARD THE IP OF THE REQUEST*<br>
>> > * if (req.restarts == 0) {*<br>
>> > * if (req.http.x-forwarded-for) {*<br>
>> > * set req.http.X-Forwarded-For =*<br>
>> > * req.http.X-Forwarded-For + ", " + client.ip;*<br>
>> > * } else {*<br>
>> > * set req.http.X-Forwarded-For = client.ip;*<br>
>> > * }*<br>
>> > * }*<br>
>> ><br>
>> > * # Purge request check sections for hash_always_miss, purge and ban*<br>
>> > * # BLOCK IF NOT IP is not in purge acl*<br>
>> > * # ##############################<wbr>############################*<br>
>> ><br>
>> > * # Enable smart refreshing using hash_always_miss*<br>
>> > *if (req.http.Cache-Control ~ "no-cache") {*<br>
>> > * if (client.ip ~ purge || !std.ip(req.http.X-Actual-IP, "1.2.3.4") ~<br>
>> > purge) {*<br>
>> > * set req.hash_always_miss = true;*<br>
>> > * }*<br>
>> > *}*<br>
>> ><br>
>> > *if (req.method == "PURGE") {*<br>
>> > * if (!client.ip ~ purge || !std.ip(req.http.X-Actual-IP, "1.2.3.4")<br>
>> ~<br>
>> > purge) {*<br>
>> > * return(synth(405,"Not allowed."));*<br>
>> > * }*<br>
>> > * return (purge);*<br>
>> ><br>
>> > * }*<br>
>> > *if (req.method == "BAN") {*<br>
>> > * # Same ACL check as above:*<br>
>> > * if (!client.ip ~ purge || !std.ip(req.http.X-Actual-IP,<br>
>> > "1.2.3.4") ~ purge) {*<br>
>> > * return(synth(403, "Not allowed."));*<br>
>> > * }*<br>
>> > * ban("req.http.host == " + req.http.host +*<br>
>> > * " && req.url == " + req.url);*<br>
>> ><br>
>> > * # Throw a synthetic page so the*<br>
>> > * # request won't go to the backend.*<br>
>> > * return(synth(200, "Ban added"));*<br>
>> > *}*<br>
>> ><br>
>> ><br>
>> > *# Unset cloudflare cookies*<br>
>> > *# Remove has_js and CloudFlare/Google Analytics __* cookies.*<br>
>> > * set req.http.Cookie = regsuball(req.http.Cookie,<br>
>> > "(^|;\s*)(_[_a-z]+|has_js)=[^;<wbr>]*", "");*<br>
>> > * # Remove a ";" prefix, if present.*<br>
>> > * set req.http.Cookie = regsub(req.http.Cookie, "^;\s*", "");*<br>
>> ><br>
>> > * # For Testing: If you want to test with Varnish passing (not caching)<br>
>> > uncomment*<br>
>> > * # return( pass );*<br>
>> ><br>
>> > * # FORWARD THE IP OF THE REQUEST*<br>
>> > * if (req.restarts == 0) {*<br>
>> > * if (req.http.x-forwarded-for) {*<br>
>> > * set req.http.X-Forwarded-For =*<br>
>> > * req.http.X-Forwarded-For + ", " + client.ip;*<br>
>> > * } else {*<br>
>> > * set req.http.X-Forwarded-For = client.ip;*<br>
>> > * }*<br>
>> > * }*<br>
>> ><br>
>> > *# DO NOT CACHE RSS FEED*<br>
>> > * if (req.url ~ "/feed(/)?") {*<br>
>> > * return ( pass ); *<br>
>> > *}*<br>
>> ><br>
>> > *## Do not cache search results, comment these 3 lines if you do want to<br>
>> > cache them*<br>
>> ><br>
>> > *if (req.url ~ "/\?s\=") {*<br>
>> > * return ( pass ); *<br>
>> > *}*<br>
>> ><br>
>> > *# CLEAN UP THE ENCODING HEADER.*<br>
>> > * # SET TO GZIP, DEFLATE, OR REMOVE ENTIRELY. WITH VARY<br>
>> ACCEPT-ENCODING*<br>
>> > * # VARNISH WILL CREATE SEPARATE CACHES FOR EACH*<br>
>> > * # DO NOT ACCEPT-ENCODING IMAGES, ZIPPED FILES, AUDIO, ETC.*<br>
>> > * # ##############################<wbr>############################*<br>
>> > * if (req.http.Accept-Encoding) {*<br>
>> > * if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|<wbr>tbz|mp3|ogg)$") {*<br>
>> > * # No point in compressing these*<br>
>> > * unset req.http.Accept-Encoding;*<br>
>> > * } elsif (req.http.Accept-Encoding ~ "gzip") {*<br>
>> > * set req.http.Accept-Encoding = "gzip";*<br>
>> > * } elsif (req.http.Accept-Encoding ~ "deflate") {*<br>
>> > * set req.http.Accept-Encoding = "deflate";*<br>
>> > * } else {*<br>
>> > * # unknown algorithm*<br>
>> > * unset req.http.Accept-Encoding;*<br>
>> > * }*<br>
>> > * }*<br>
>> ><br>
>> > * # PIPE ALL NON-STANDARD REQUESTS*<br>
>> > * # ##############################<wbr>############################*<br>
>> > * if (req.method != "GET" &&*<br>
>> > * req.method != "HEAD" &&*<br>
>> > * req.method != "PUT" && *<br>
>> > * req.method != "POST" &&*<br>
>> > * req.method != "TRACE" &&*<br>
>> > * req.method != "OPTIONS" &&*<br>
>> > * req.method != "DELETE") {*<br>
>> > * return (pipe);*<br>
>> > * }*<br>
>> ><br>
>> > * # ONLY CACHE GET AND HEAD REQUESTS*<br>
>> > * # ##############################<wbr>############################*<br>
>> > * if (req.method != "GET" && req.method != "HEAD") {*<br>
>> > * return (pass);*<br>
>> > * }*<br>
>> ><br>
>> > * # OPTIONAL: DO NOT CACHE LOGGED IN USERS (THIS OCCURS IN FETCH TOO,<br>
>> > EITHER*<br>
>> > * # COMMENT OR UNCOMMENT BOTH*<br>
>> > * # ##############################<wbr>############################*<br>
>> > * if ( req.http.cookie ~ "wordpress_logged_in" ) {*<br>
>> > * return( pass );*<br>
>> > * }*<br>
>> ><br>
>> > * # IF THE REQUEST IS NOT FOR A PREVIEW, WP-ADMIN OR WP-LOGIN*<br>
>> > * # THEN UNSET THE COOKIES*<br>
>> > * # ##############################<wbr>############################*<br>
>> > * if (!(req.url ~ "wp-(login|admin)") *<br>
>> > * && !(req.url ~ "&preview=true" ) *<br>
>> > * ){*<br>
>> > * unset req.http.cookie;*<br>
>> > * }*<br>
>> ><br>
>> > * # IF BASIC AUTH IS ON THEN DO NOT CACHE*<br>
>> > * # ##############################<wbr>############################*<br>
>> > * if (req.http.Authorization || req.http.Cookie) {*<br>
>> > * return (pass);*<br>
>> > * }*<br>
>> ><br>
>> > * # IF YOU GET HERE THEN THIS REQUEST SHOULD BE CACHED*<br>
>> > * # ##############################<wbr>############################*<br>
>> > * return (hash);*<br>
>> > * # This is for phpmyadmin*<br>
>> > *if (req.http.Host == "<a href="http://ki1.org" rel="noreferrer" target="_blank">ki1.org</a> <<a href="http://ki1.org" rel="noreferrer" target="_blank">http://ki1.org</a>>") {*<br>
>> > *return (pass);*<br>
>> > *}*<br>
>> ><br>
>> > *if (req.http.Host == "<a href="http://mysql.ki1.org" rel="noreferrer" target="_blank">mysql.ki1.org</a> <<a href="http://mysql.ki1.org" rel="noreferrer" target="_blank">http://mysql.ki1.org</a>>") {*<br>
>> > *return (pass);*<br>
>> > *}*<br>
>> ><br>
>> > *}*<br>
>> ><br>
>> > *# HIT FUNCTION*<br>
>> > *# ##############################<wbr>############################*<br>
>> > *sub vcl_hit {*<br>
>> > * # IF THIS IS A PURGE REQUEST THEN DO THE PURGE*<br>
>> > * # ##############################<wbr>############################*<br>
>> > * if (req.method == "PURGE") {*<br>
>> > * #*<br>
>> > * # This is now handled in vcl_recv.*<br>
>> > * #*<br>
>> > * # purge;*<br>
>> > * return (synth(200, "Purged."));*<br>
>> > * }*<br>
>> > * return (deliver);*<br>
>> > *}*<br>
>> ><br>
>> > *# MISS FUNCTION*<br>
>> > *# ##############################<wbr>############################*<br>
>> > *sub vcl_miss {*<br>
>> > * if (req.method == "PURGE") {*<br>
>> > * #*<br>
>> > * # This is now handled in vcl_recv.*<br>
>> > * #*<br>
>> > * # purge;*<br>
>> > * return (synth(200, "Purged."));*<br>
>> > * }*<br>
>> > * return (fetch);*<br>
>> > *}*<br>
>> ><br>
>> > *# FETCH FUNCTION*<br>
>> > *# ##############################<wbr>############################*<br>
>> > *sub vcl_backend_response {*<br>
>> > * # I SET THE VARY TO ACCEPT-ENCODING, THIS OVERRIDES W3TC *<br>
>> > * # TENDANCY TO SET VARY USER-AGENT. YOU MAY OR MAY NOT WANT*<br>
>> > * # TO DO THIS*<br>
>> > * # ##############################<wbr>############################*<br>
>> > * set beresp.http.Vary = "Accept-Encoding";*<br>
>> ><br>
>> > * # IF NOT WP-ADMIN THEN UNSET COOKIES AND SET THE AMOUNT OF *<br>
>> > * # TIME THIS PAGE WILL STAY CACHED (TTL)*<br>
>> > * # ##############################<wbr>############################*<br>
>> > * if (!(bereq.url ~ "wp-(login|admin)") && !bereq.http.cookie ~<br>
>> > "wordpress_logged_in" ) {*<br>
>> > * unset beresp.http.set-cookie;*<br>
>> > * set beresp.ttl = 52w;*<br>
>> > *# set beresp.grace =1w;*<br>
>> > * }*<br>
>> ><br>
>> > * if (beresp.ttl <= 0s ||*<br>
>> > * beresp.http.Set-Cookie ||*<br>
>> > * beresp.http.Vary == "*") {*<br>
>> > * set beresp.ttl = 120 s;*<br>
>> > * # set beresp.ttl = 120s;*<br>
>> > * set beresp.uncacheable = true;*<br>
>> > * return (deliver);*<br>
>> > * }*<br>
>> ><br>
>> > * return (deliver);*<br>
>> > *}*<br>
>> ><br>
>> > *# DELIVER FUNCTION*<br>
>> > *# ##############################<wbr>############################*<br>
>> > *sub vcl_deliver {*<br>
>> > * # IF THIS PAGE IS ALREADY CACHED THEN RETURN A 'HIT' TEXT *<br>
>> > * # IN THE HEADER (GREAT FOR DEBUGGING)*<br>
>> > * # ##############################<wbr>############################*<br>
>> > * if (obj.hits > 0) {*<br>
>> > * set resp.http.X-Cache = "HIT";*<br>
>> > * # IF THIS IS A MISS RETURN THAT IN THE HEADER*<br>
>> > * # ##############################<wbr>############################*<br>
>> > * } else {*<br>
>> > * set resp.http.X-Cache = "MISS";*<br>
>> > * }*<br>
>> > *}*<br>
>> ><br>
>> ><br>
>> > Thanks,<br>
>> ><br>
>> -------------- next part --------------<br>
>> An HTML attachment was scrubbed...<br>
>> URL: <<a href="https://www.varnish-cache.org/lists/pipermail/varnish-misc/" rel="noreferrer" target="_blank">https://www.varnish-cache.<wbr>org/lists/pipermail/varnish-<wbr>misc/</a><br>
>> attachments/20160804/4e3f064a/<wbr>attachment.html><br>
>><br>
>> ------------------------------<br>
>><br>
>> ______________________________<wbr>_________________<br>
>> varnish-misc mailing list<br>
>> <a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
>> <a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/<wbr>varnish-misc</a><br>
>><br>
>> End of varnish-misc Digest, Vol 125, Issue 14<br>
>> ******************************<wbr>***************<br>
>><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> varnish-misc mailing list<br>
> <a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
> <a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/<wbr>varnish-misc</a><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20160804/e791cc0e/attachment.html" rel="noreferrer" target="_blank">https://www.varnish-cache.<wbr>org/lists/pipermail/varnish-<wbr>misc/attachments/20160804/<wbr>e791cc0e/attachment.html</a>><br>
<br>
------------------------------<br>
<br>
______________________________<wbr>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/<wbr>varnish-misc</a><br>
<br>
End of varnish-misc Digest, Vol 125, Issue 16<br>
******************************<wbr>***************<br>
</blockquote></div><br></div>