Load FluentCart Only Where You Sell with FluentCart Optimizer
FluentCart loads its storefront scripts and styles on every page of your site by default. That keeps the cart drawer ready wherever a visitor goes, but your blog posts, About page and contact form pay for it on every visit, even though nobody buys anything there.
FluentCart Optimizer lets you keep that bundle on the pages that sell and leave it off the pages that don’t. It changes nothing until you choose a setting, and you can go back to FluentCart’s own behavior with one click.
What It Changes
On the QA store, a plain content page went from 6 FluentCart files, 60.6 KB before compression, to none. The shop, product, checkout, account and embedded-product pages kept every file. Your numbers depend on your theme, your plugins and your cache, so measure your own store before and after.
Turn It On
- In GT Extensions → Modules, turn on FluentCart Optimizer.
- Open FluentCart → Optimizer.
- Under Storefront assets, choose Store pages only.
- Save settings, then clear cached pages with your usual cache tool.
The module starts on Native behavior, so switching it on alone doesn’t change any page. It also never purges a cache for you. If your FluentCart doesn’t offer the asset filter the optimizer needs, Store pages only is greyed out and native behavior stays.
What Store Pages Only Keeps
Store pages only removes the bundle only from pages it can show are free of commerce. Any doubt keeps FluentCart’s normal loading. These always keep the bundle:
- shop, product, cart, checkout, account, login, registration and receipt pages
- instant checkout and modal checkout
- any page with a FluentCart or GT Extensions store block or shortcode, including inside synced patterns
- any visitor who has items in the cart, so the cart drawer stays
- visits with campaign parameters, a
?coupon=link or a referrer from another site, so FluentCart still records where the visitor came from - pages built with a page builder or unknown shortcodes, which keep native behavior because their content can’t be read reliably
- every page, when a site-wide header, footer, template part or widget uses FluentCart
The optimizer can trim a page FluentCart wanted to load on. It never loads the bundle on a page where FluentCart decided not to.
Floating Cart Button
The Floating cart button setting has two choices. Native shows it wherever FluentCart loads its cart. Only on store pages and pages that embed products hides it on pages that don’t sell anything, even for visitors who still need the cart drawer there.
Always Load Store Assets on Chosen Pages
Some pages show store controls the optimizer can’t see, such as a buy button added by a builder widget or a script. Keep the bundle on those pages in any of three ways:
- tick Always load FluentCart store assets here in the Store assets box of the page editor
- add the page or post ID under Always load store assets on, separated by commas
- add a URL path prefix such as
/landing/, one per line, up to 50
Check What Happened on a Page
Signed in as an administrator, open any page on your site. The toolbar shows Store assets: loaded or Store assets: trimmed, with the reason, such as “A FluentCart store page.” or “No commerce found: store assets are trimmed.”
Use it to spot-check your important pages after you switch modes. If a page that sells something shows trimmed, add it to the always-load list.
Cache and Script Report
The Optimizer screen builds a cache and script report from your store pages, cookies, endpoints and enabled modules. Copy it into your cache plugin or CDN settings. It tells you which pages and cookies must skip the cache and which scripts must not be delayed or combined.
The report is guidance from your store settings. A plugin can’t see what an upstream CDN does, so check the result in a private window. If Checkout Cache Buster is off, the screen links to the modules page so you can turn it on.
Other Checks on the Screen
- Site-wide check: lists any template part or widget area that uses FluentCart. Click Check again after you change your header, footer or widgets.
- Build integrity: confirms every GT Extensions stylesheet and script has its minified build. If something is missing, reinstall the plugin package.
Cart Retention
FluentCart deletes carts that haven’t changed for 30 days in its own daily cleanup. Under Cart retention you can keep them longer: 45, 60, 90, 180 or 365 days. The screen shows when FluentCart’s cleanup runs next and about how many carts are older than your setting.
Nothing shorter than 30 days is offered, because GT Extensions’ locked, invoice and saved carts depend on carts surviving at least that long.
Undo a Change
Each time you save different settings, the previous settings are kept. The Restore section lists the last five, with a Restore these settings button for each. Restore native behavior now puts every setting back to FluentCart’s own defaults.
Turning the module off has the same effect as native behavior. After any change, clear your cached pages so visitors get it.
One Limitation
A visitor who lands on a trimmed page without campaign parameters or an outside referrer, then browses to your shop, is recorded by FluentCart from the shop page onward. Coupon Affiliates commissions are not affected, because they come from the coupon on the order.
Measure It Yourself
Compare four pages with the optimizer off and on: a plain content page, a product, checkout and the account page. Load each five times with an empty cache and five times with a warm cache, on desktop and on mobile. Note the JavaScript and CSS transferred, the number of requests, time to first byte and Largest Contentful Paint.
For Developers
The gtfc/optimizer/should_load_store_assets filter receives null, the optimizer’s decision and the page signals. Return true or false to decide for that page, or null to keep the optimizer’s decision. A true can’t load the bundle where FluentCart itself left it off.
The gtfc/optimizer/sitewide_sources filter receives the list of site-wide places using FluentCart. Add an entry when your theme renders store controls on every page in a way the site-wide check can’t find.