Last Updated: February 25, 2016
·
471
· matthewbdaly

Rules for sub vcl_recv to make Varnish play nice with WooCommerce

 if (req.url ~ "^/(cart|my-account|checkout|addons)") {
    return (pass);
}
if ( req.url ~ "\?add-to-cart=" ) {
    return (pass);
}
if ( req.url ~ "^/wp-(admin|login)" ) {
  return (pass);
}
if ( req.url ~ "wc-api" ) {
  return (pass);
}

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

WordPress sites collect scripts from themes, plugins, and tag managers. A compromised plugin update can add a skimmer to every page without a change in your own templates.

Security insights from Cside