AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
![]() ![]() Using the snippet below, you can limit the execution of the cart-fragments script to specific pages. Limit Cart Sync functionality to specific WooCommerce pages We’re still investigating safe ways we can reduce this performance hit for usage of cart-fragments across all stores while preserving backward compatibility but in the meantime, here are some suggested best practices for further reducing the impact of using this API. With the changes applied via WooCommerce 7.8, this impact is minimized to pages that have the Cart widget active, when third party scripts register cart-fragments as a dependency, or when explicitly enqueued in code. On heavily trafficked stores, this could severely impact the load on the server and the responsiveness of a site. This was less than ideal leading to unnecessary additional AJAX requests to the server. Prior to the change introduced in WooCommerce 7.8, the cart fragments script was enqueued on every page load in a WooCommerce even if the mini-cart widget wasn’t present on the page. There’s also some special handling for invoking in the context of the WordPress customizer.Īs you can see, there are a number of places where this AJAX call is invoked by the cart fragments script to keep the mini cart widget up to date.This is mostly a fix addressing a quirk with Safari’s behaviour of aggressively caching views in browser history. When a page is shown after the browser button/action is used.The day in milliseconds timeout for invoking the refreshing of the cart is also set on initial page load. This helps keep left-open tabs from going stale if the shopper has multiple tabs open while they are shopping. Tested with twentytwenty theme and FLuent forms was the only active plugin. wp-editor script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). ![]()
0 Comments
Read More
Leave a Reply. |