php - Varnish does not cache multiple wordpress -


i have setup varnish on high end dedicated server whm running around 10-13 websites, on wordpress. i'm seeing hit rate low , miss rate high in "varnishhist". also, when varnishtop -i txurl, see "/" url (and not each website url) being requested apache @ higher rate. below excerpt:

4.02 txurl / 1.00 txurl /wp-content/uploads/2014/12/034kj343.jpg 0.96 txurl /wp-content/uploads/2014/12/dfkkj30434.jpg 0.96 txurl /wp-content/uploads/2014/10/3403402022.jpg 

i believe varnish must cache home page of every single site , send client rather requesting backend. suggestions please?

ok. managed find solution. here current vcl file works good.

 sub vcl_recv{        if (req.http.cookie && req.http.cookie ~ "(wordpress_|phpsessid)")     { return(pass); }      if (req.url ~ "wp-admin|wp-login") {     return (pass);     }     else{     unset req.http.cookie;     } #since can not unset all, leave wp-admin } sub vcl_backend_response {     if (bereq.url !~ "wp-admin|wp-login") {             unset beresp.http.set-cookie;     }     #beware ignoreing headers now:     unset beresp.http.cache-control;      # cache 60 minutes     if(beresp.ttl <= 0s) { set beresp.ttl = 3600s; } } 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -