Mini cart speed
The mini cart adds about 3 KB of CSS and 3 KB of JavaScript (gzipped) to other pages, with no jQuery and no WooCommerce cart fragments script.
What makes it fast#
- No request when nothing changed. It makes no extra request when the cart is empty or unchanged.
- Warm-up. The drawer starts loading when the shopper points at, focuses or touches the cart button, so it is usually ready by the click.
- Background load. When the cart has items, the drawer loads in the background once the page has finished loading (not on data saver connections), so it opens at once.
- Light first load. Its first load uses a lighter request that builds only the drawer, not WooCommerce’s full set of cart fragments.
- Kept in the browser tab. On later pages of the visit, an unchanged cart shows at once from the browser tab. The kept drawer belongs to the plugin version, settings and texts it was built with, so changes show on the next page.
Load the items when the mini cart opens#
Mini cart > Load the items when the mini cart opens: pages no longer build the cart items, prices and recommendations on every view while the drawer is closed. They load in a moment the first time it opens. The cart count still shows right away.
Turn it on for stores with heavy carts or many recommendations.
Caching#
The mini cart works with page caching. The drawer and the count are loaded per shopper, so a cached page never shows someone else’s cart.
Tip
After changing settings, clear your page cache so every page gets the new version.