Control Web Panel

WebPanel => Apache => Varnish => Topic started by: filz51 on May 11, 2021, 11:52:58 AM

Title: Varnish cache rule
Post by: filz51 on May 11, 2021, 11:52:58 AM
I need to disable Varnish caching for logged in wordpress users
The rule is for
Code: [Select]
sub vcl_recv {
   
Code: [Select]
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?
Title: Re: Varnish cache rule
Post by: studio4host on May 12, 2021, 06:27:54 AM
this info is on cwp wiki
http://wiki.centos-webpanel.com/webservers-vhost-templates
Title: Re: Varnish cache rule
Post by: filz51 on May 12, 2021, 09:21:28 AM
Thank you!