JezK
Edit File: third-party-compat.php
<?php /** * Compatibility shims for third-party plugins that break the Varnish cache. * * A plugin that writes its cookies from PHP makes every response carry a * Set-Cookie header, which Varnish has to treat as uncacheable. Where the * plugin offers a supported way to keep those cookies client-side, we opt * into it here. * * Shims hook in at an early priority so a Box can still override them with * the same filter at the default priority. */ if ( ! defined( 'WPINC' ) ) { die; } /** * facebook-for-woocommerce * * The plugin bundles Meta's CAPI Param Builder and calls setcookie() for _fbp * (and _fbc) straight from the EventsTracker constructor, on every request. * That bypasses the cache for the whole Box, not just the shop pages. * * Holding the signals is the plugin's own cache-safe path: attribution IDs are * still generated, fbevents.js writes the cookies client-side instead of PHP, * and queued CAPI events are delivered through the admin-ajax release * endpoint, which is never cached. */ add_filter( 'facebook_signals_held', '__return_true', 5 );