April 2, 2020
Estimated Post Reading Time ~

What's new in AEM Html Library Manager?

The CQ "CQ Html Library Manager" component controls the handling of client libraries (JavaScript, CSS) minification to remove CRLF and whitespace characters in order to reduce the size of the file. In the Earlier version of CQ with minification enabled OR disabled, both the minified OR unminified library version has the same URL. With AEM 5.6 onwards enabling minification adds a selector "min", Thereby differentiates the difference in URL for both minified and unminified versions of the library.
  • It helps to test both unminified & minified versions irrespective of OSGi configuration by directly requesting the file from the browser. I.e, Once you develop your client library by following [1] you can test directly how much it minifies by adding a selector "min". For example, the granite library the URL for raw (unminified) and the minified file looks like [A] & [B]. 

       http://<host>:<port>/etc/clientlibs/granite/jquery/granite.js

       http://<host>:<port>/etc/clientlibs/granite/jquery/granite.min.js
  • If you have minified enabled in "CQ Html Library Manager" & all your library follows basic functionality of Client Library [1]. Then while restricting access via the Dispatcher make sure to have a stricter filter like [C][C]

# enable specific mime types in non-public content directories
/0041 { /type "allow" /glob "* *.min.css *" } # enable css
/0044 { /type "allow" /glob "* *.min.js *" } # enable javascript


References:
http://dev.day.com/docs/en/cq/current/developing/widgets.html
http://experiencedelivers.adobe.com/cemblog/en/experiencedelivers/2012/12/clientlibs-explained-by-example.html


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.