Load astra’s woo css/js on all site pages and destroys Performance
-
Hello.
After the next theme update i discovered that astra began to load resources for woocommrce on all site pages.
/plugins/astra-addon/addons/woocommerce/assets/js/minified/single-product-ajax-cart.min.js /themes/astra/assets/css/minified/compatibility/woocommerce/woocommerce-layout.min.css /themes/astra/assets/css/minified/compatibility/woocommerce/woocommerce.min.css /themes/astra/assets/css/minified/compatibility/woocommerce/woocommerce-smallscreen.min.css
Then i noticed my site failed the googles speed test.
I have a standard function that disables loading woocommerce resources on all pages where there is no woocommerce (from this https://gist.github.com/DevinWalker/7621777#file-woocommerce-optimize-scripts-php).
And this works both for the main Woocommerce plugin and for other plugins related to woocommerce.
BUT this does not work for styles and scripts that Astra loads.
My website has over 50,000 pages. Of these, the woocommerce works on only 100 pages. And it turns out that on 49,950 pages the theme loads scripts that are not needed at all and spoil the speed.
Is it possible to prevent the theme from loading unnecessary resources where there is definitely no plugin (no cart, products, and generally everything related to the woo)?
- The topic ‘Load astra’s woo css/js on all site pages and destroys Performance’ is closed to new replies.