Varnish cache rule

Started by filz51, May 11, 2021, 11:52:58 AM

Previous topic - Next topic

filz51

I need to disable Varnish caching for logged in wordpress users
The rule is for
sub vcl_recv {

   if (req.http.cookie ~ "wordpress_logged_in") {
           return (pass);
}

if (req.http.Cache-Control ~ "(no-cache|no-store|private)") {
           return (pass);
}


When I paste it into /etc/varnish/conf.d/vhosts/MYDOMAIN.conf and rebuild the webserver, these rules are lost. Can I paste them somewhere else (template?) where it's not overridden after rebuilding the server?

studio4host

VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

filz51