Systems Tuning
Varnish VCL Cookie Stripping & WooCommerce wc-ajax Bypass
Prevent marketing UTM parameters, _ga cookies, and Facebook pixels from busting your Varnish hit ratio while keeping WooCommerce cart fragments dynamic.
90%+ Catalog Hit Rate · Safe Cart & Checkout · Clean Vary Headers
Why One Analytics Cookie Can Drop Varnish Hit Rate to 0%
By default, Varnish refuses to cache any request carrying a Cookie header. Because Google Analytics and ad pixels set first-party cookies on the first visit, stripping non-auth cookies in vcl_recv is mandatory for real-world cache hits.
Cleaning Set-Cookie on Static Catalog Pages
In vcl_backend_response, unset beresp.http.Set-Cookie on anonymous 200 GET responses so stray PHP session headers never leak across cached catalog pages.
Measured Parameters & CloudPanel Stack Directives
| VCL Rule | Cookie / URL Match | Cache Action |
|---|---|---|
| Strip Marketing Cookies | _ga*, _gid, _fbp, utm_*, gclid | Removed in vcl_recv before cache hash |
| Bypass Logged-In Users | wordpress_logged_in_, wp-postpass_ | return (pass) directly to Nginx :8080 |
| Bypass Active Carts | woocommerce_items_in_cart, cart_hash | return (pass) so cart badge stays live |
| Bypass AJAX & Admin | /wp-admin, /checkout, ?wc-ajax= | return (pass) without touching cache |