<div dir="ltr"><div>Hi,</div><div><br></div><div>Sure. Here is a hint.</div><div><br></div>Read through the the relevant parts of the Varnish Book or <a href="http://varnish-cache.org">varnish-cache.org</a>'s "Users Guide". What you're looking for is "passing" certain requests. You'll control this in vcl_recv and the part that tests on the query string will look something like this:<div><br></div><div>if (req.url ~ "\?.*foo=bar") {</div><div> return(pass);</div><div>}</div><div><br></div><div>You might want to have a look at the cookie vmod, especially if you struggle with regular expressions.</div><div><br></div><div>Per.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 23, 2015 at 7:56 PM, Xavier Cardil Coll <span dir="ltr"><<a href="mailto:info@elsitar.com" target="_blank">info@elsitar.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">No one knows then ? Not even a hint or something ?<img width="0" height="0" src="https://mailtrack.io/trace/mail/cb6783af44ef37d67944a6ee118a0166d6fd51f0.png"></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">2015-12-23 13:15 GMT+01:00 Xavier Cardil Coll <span dir="ltr"><<a href="mailto:info@elsitar.com" target="_blank">info@elsitar.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Also, how to write a function to bypass cache entirely when a user logs in ? <img width="0" height="0"></div><div class="gmail_extra"><div><div><br><div class="gmail_quote">2015-12-23 12:39 GMT+01:00 Xavier Cardil Coll <span dir="ltr"><<a href="mailto:info@elsitar.com" target="_blank">info@elsitar.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px;margin-top:0px!important">On Nginx cache, you can do this to avoid keep on caching when you add something to the cart in Woocommerce :</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px">Skip cache for WooCommerce query string</p><pre style="overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:11.9px;margin-top:0px;margin-bottom:16px;font-stretch:normal;line-height:1.45;padding:16px;border-radius:3px;word-wrap:normal;color:rgb(51,51,51);background-color:rgb(247,247,247)"><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:11.9px;padding:0px;margin:0px;border-radius:3px;border:0px;display:inline;max-width:initial;overflow:initial;line-height:inherit;word-wrap:normal;background:transparent">if ( $arg_add-to-cart != "" ) {
set $skip_cache 1;
}
</code></pre><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px">Skip cache when WooCommerce cart is not empty</p><pre style="overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:11.9px;margin-top:0px;margin-bottom:16px;font-stretch:normal;line-height:1.45;padding:16px;border-radius:3px;word-wrap:normal;color:rgb(51,51,51);background-color:rgb(247,247,247)"><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:11.9px;padding:0px;margin:0px;border-radius:3px;border:0px;display:inline;max-width:initial;overflow:initial;line-height:inherit;word-wrap:normal;background:transparent">if ( $cookie_woocommerce_items_in_cart != "0" ) {
set $skip_cache 1;
}
</code></pre><p style="margin-top:0px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px;margin-bottom:0px!important">How can you do this in Varnish ? With this config, wich was made specifically for Wordpress + Woocommerce, when you add something to cart, cache is not disable store wide so you get a mix of cached and non cache pages, cart gets emptied : <a href="http://pastebin.com/TuYeMtUZ" style="color:rgb(64,120,192);text-decoration:none;background-color:transparent" target="_blank">http://pastebin.com/TuYeMtUZ</a></p><span><font color="#888888"><div><br></div>-- <br><div><div dir="ltr"><div><div><br></div><div><font color="#ffffff">ELSITAR</font></div><div></div><div><br></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><img src="https://docs.google.com/uc?export=download&id=0B3XfePYC7r00QkVpTzFuYWx4NUU&revid=0B3XfePYC7r00amZwVHAxMGVxeUNhUFNzSGhlRUhadFBjbjlRPQ" width="200" height="87"><br></div></div></div></div></div>
<img width="0" height="0"></font></span></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div><div dir="ltr"><div><div><br></div><div><font color="#ffffff">ELSITAR</font></div><div></div><div><br></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><img src="https://docs.google.com/uc?export=download&id=0B3XfePYC7r00QkVpTzFuYWx4NUU&revid=0B3XfePYC7r00amZwVHAxMGVxeUNhUFNzSGhlRUhadFBjbjlRPQ" width="200" height="87"><br></div></div></div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div><div dir="ltr"><div><div><br></div><div><font color="#ffffff">ELSITAR</font></div><div></div><div><br></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><img src="https://docs.google.com/uc?export=download&id=0B3XfePYC7r00QkVpTzFuYWx4NUU&revid=0B3XfePYC7r00amZwVHAxMGVxeUNhUFNzSGhlRUhadFBjbjlRPQ" width="200" height="87"><br></div></div></div></div></div>
</font></span></div>
<br>_______________________________________________<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/lists/mailman/listinfo/varnish-misc</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><table border="0" cellpadding="0" cellspacing="0" style="border-bottom-width:1px;padding-top:5px;border-top-style:solid;width:550px;padding-bottom:5px;border-bottom-color:rgb(238,238,238);border-top-width:1px;border-bottom-style:solid;line-height:1.5em;border-top-color:rgb(238,238,238);color:rgb(102,102,102);font-size:12px;font-family:'Helvetica Neue',Arial,sans-serif;margin-top:20px"><tbody><tr><td width="100"><img src="http://www.varnish-software.com/static/media/logo-email.png"></td><td><font color="#222222"><span style="font-size:14px"><b>Per Buer</b></span></font><br>CTO | Varnish Software AS<br>Cell: <a value="+4790181750" style="color:rgb(17,85,204)">+47 95839117</a><br><span style="font-weight:bold">We Make Websites Fly!<br><a href="https://www.varnish-software.com/" style="color:rgb(17,85,204)" target="_blank">www.varnish-software.com</a></span></td></tr></tbody></table><br><div style="color:rgb(136,136,136)"><a href="http://info.varnish-software.com/signature" target="_blank"><img src="http://files.varnish-software.com/signature.png"></a><br></div></div></div></div></div>
</div>