Enable and configure the Asset Optimizer
The Asset Optimizer is a module that optimizes CSS styles and JS scripts. When it is enabled in a production environment, the Asset Optimizer improves overall site performance by reducing the amount of data that needs to be transferred. Sitecore administrators can enable this module either globally for the entire Sitecore instance or locally for selected tenants.
It is best practice to disable the Asset Optimizer in development environments and to enable it in production environments.
Enable the Asset Optimizer globally
To enable the optimizer globally:
-
In the Content Editor, navigate to
/sitecore/system/Settings/Foundation/Experience Accelerator/Theming/Optimiser
and for both Scripts and Styles select Concatenate and Minify to minify all files and concatenate them into one file.
Changes take effect immediately after the item is saved. Anonymous users might not see the changes until you publish.
If you are using ES6, this back-end optimization is not compatible. Instead, use ECMAScript 6+.
Change the optimization settings for a specific site
To change the optimization settings for a specific site:
-
In the Content Editor, navigate to
sitecore/content/<Tenant>/<Site>/Presentation/Page Designs
. -
In the Asset Optimization section, in the Styles Optimizing Enabled and Scripts Optimizing Enabled fields, to override styles and scripts optimization settings, select:
-
Default – to inherit global settings
-
Yes – to always enable optimization for this site.
-
No – to always disable optimization for this site.
-