Disable WooCommerce Cart Fragments
Often slow performance and errors on WooCommerce sites are caused by a high number of AJAX requests, as these requests are uncached. If you are running a WooCommerce site on WP Engine and notice a high number of AJAX requests, disabling Cart Fragments AJAX may help improve your site’s stability.
About WooCommerce Cart Fragments
WooCommerce “Cart Fragments” is a script using admin ajax to update the cart without refreshing the page. This functionality will slow down the speed of your site or break caching on pages that don’t actually require cart information.
For example, Cart Fragments on static posts, pages, custom post types and feed pages that contain no eCommerce functionality will decrease cacheability and ultimately degrade server performance.
The Cart Fragments will appear as follows in your Access Log:
31/Dec/2017:23:59:59 +0000|v1|184.108.40.206|www.testsite.wpengine.com|200|210|127.0.0.1:80|0.328|0.330|POST /?wc-ajax=get_refreshed_fragments HTTP/2.0||
Disable Cart Fragments
- Add a plugin with a cart fragmentation disabling feature, such as “Disable Cart Fragments” or “Perfmatters”, to your site.
- Follow this guide to disable cart fragmentation through editing the
functions.phpfile of your theme.
NEXT STEP: Read about WooCommerce Best Practices