Enable or disable JS and CSS aggregation and minification

  • Updated

When troubleshooting some issues it may be useful to disable Ektron's aggregation and minification of js and css files. The aggregation piece combines multiple js/css files into 1 larger file and the minification removes extra spacing.

When troubleshooting issues in the site it is more useful to disable these pieces to capture errors that may be occurring or find specific line numbers and files that may be causing an issue.

 

Please note that these changes should be made on a temporary basis as they will impact performance in loading js and css resources.

  1. Navigate to your site root folder and open the file ektron.cms.framework.ui.config

  2. In this file find the following section (located near the bottom). If you need to debug a js issue, change the values of AllowJavaScriptAggregation and AllowJavaScriptMinification from true to false. If debugging css issues, change AllowCssAggregation and AllowCssMinification to false.  Be careful not to change AllowJavaScriptRegistration as all javascript registration will cease to function. 

    <add name="AllowJavaScriptRegistration" value="true" />
    <add name="AllowJavaScriptAggregation" value="false" />
    <add name="AllowJavaScriptMinification" value="false" />
    <!-- value = how long in days the js stays in browser cache before js is considered stale via Expires HTTP Header -->
    <add name="JavaScriptExpires" value="365" />
    <!-- value = how long in days (internally converted to seconds) the js stays in browser cache before js is considered stale via Max-Age HTTP Header -->
    <add name="JavaScriptMaxAge" value="365" />
    <!-- Css -->
    <add name="AllowCssRegistration" value="true" />
    <add name="AllowCssAggregation" value="false" />
    <add name="AllowCssMinification" value="false" />
    <add name="AggregatedCssMediaAttribute" value="all" />

  1. Update the AllowJavaScriptAggregation/Minification or AllowCssAggregation/Minification values to be true (if you want to enable it - this is the default setting) and false if you want to disable it