<div dir="ltr">thank you so much for this information,  I will get hands down with it. <img width="0" height="0" class="mailtrack-img" src="https://mailtrack.io/trace/mail/b81be2eb882d254da65d085dcaaf5f32bb5c2faf.png"></div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-23 22:35 GMT+01:00 Tobias Honacker <span dir="ltr"><<a href="mailto:t.honacker@googlemail.com" target="_blank">t.honacker@googlemail.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">Hi Xavier,<div><br></div><div>maybe this snippet will help you<br><div><br></div><div>Cookie: <a href="https://github.com/lkarsten/libvmod-cookie" target="_blank">https://github.com/lkarsten/libvmod-cookie</a></div><div>Query String: <a href="https://github.com/Dridi/libvmod-querystring" target="_blank">https://github.com/Dridi/libvmod-querystring</a></div><div><br></div><div>default.vcl:</div><div><br></div><div>import cookie;</div><div>import querystring;<br></div><div><br></div><div>sub vcl_recv:</div><div><br></div><div><div>if (req.url ~ "^/random/url") {</div><div>    cookie.parse(req.http.Cookie);</div><div>   cookie.filter_except("cookie_woocommerce");</div><div>    if ((cookie.isset("<span style="color:rgb(80,0,80);font-size:12.8px">cookie_woocommerce</span>")) {</div><div>      return(pass);</div><div>    } else {</div><div>      return(hash);</div><div>    }</div><div>} // to get the value out of the cookie -> cookie.get("woocommerce") != "false"</div></div><div><br></div><div><div>and something like this</div><div><br></div><div> set req.url = querystring.sort(req.url);</div><div> set req.url = querystring.filter(req.url, "query_string");</div></div><div> ... do some magic</div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2015-12-23 21:05 GMT+01:00 Guillaume Quintard <span dir="ltr"><<a href="mailto:guillaume@varnish-software.com" target="_blank">guillaume@varnish-software.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr"><span><br>
On Dec 23, 2015 20:51, "Xavier Cardil Coll" <<a href="mailto:info@elsitar.com" target="_blank">info@elsitar.com</a>> wrote:<br>
><br>
> No one knows then ? Not even a hint or something ?<br>
><br></span><span>
> 2015-12-23 13:15 GMT+01:00 Xavier Cardil Coll <<a href="mailto:info@elsitar.com" target="_blank">info@elsitar.com</a>>:<br>
>><br>
>> Also, how to write a function to bypass cache entirely when a user logs in ? <br>
>><br></span><span>
>> 2015-12-23 12:39 GMT+01:00 Xavier Cardil Coll <<a href="mailto:info@elsitar.com" target="_blank">info@elsitar.com</a>>:<br>
>>><br>
>>> On Nginx cache, you can do this to avoid keep on caching when you add something to the cart in Woocommerce :<br>
>>><br>
>>> Skip cache for WooCommerce query string<br>
>>><br>
>>> if ( $arg_add-to-cart != "" ) { <br>
>>>       set $skip_cache 1;<br>
>>> }<br>
>>><br>
>>> Skip cache when WooCommerce cart is not empty<br>
>>><br>
>>> if ( $cookie_woocommerce_items_in_cart != "0" ) {   <br>
>>>     set $skip_cache 1;<br>
>>> }<br>
>>><br>
>>> 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" target="_blank">http://pastebin.com/TuYeMtUZ</a><br>
>>><br>
>>><br>
>>> -- <br>
>>><br>
>>> ELSITAR<br>
>>><br>
>>><br>
>><br>
>><br>
>><br></span>
>> -- <br>
>><br>
>> ELSITAR<br>
>><br>
>><br>
><br>
><br>
><br>
> -- <br>
><br>
> ELSITAR<br>
><br>
><br>
><br>
> _______________________________________________<br>
> varnish-misc mailing list<br>
> <a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br>
> <a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a></p>
<p dir="ltr">Chill out, most of the people are in vacation :-)</p>
<p dir="ltr">So, in varnish, by default, if the request contains a cookie, the cache is bypassed.</p>
<p dir="ltr">But you can also force a pass, for example if the request contains a "foo-bar" header like so :</p>
<p dir="ltr">sub vcl_recv {<br>
   if (req.http.foo-bar) {<br>
      return (pass);<br>
   }<br>
}</p>
<p dir="ltr">For your needs, look at the query string and cookie vmods, it will allow to really fine-tune your workflow.</p>
<p dir="ltr">And should you need more help, we are here :-)</p>
<br>_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">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></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><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>
</div>