Expand my Community achievements bar.

SOLVED

Avoiding /Libs folder js files

Avatar

Level 1

Hi,

I am trying not to load the js files in Libs folder which includes cq folder with bunch of js files and also some media/publishing js folders I am not sure where are we including these js files and also i am not using these files which is increasing my page load time. one solution we thought was having a dispatcher would solve the problem it worked but giving 404 to files avoided but was not completely eliminated. Should we uninstall any bundles or components from system/console/components please let me know.

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 5

Srikanth,

Is it Author Or Publish ? I guess instead of removing from dispatcher (Which will give 404 any way), you should find out what all components are using those include and remove those component instead if not needed.

Some of non required one are, ClientContext (If you are not using personalization), Timing component (Unless you want to find component load time in publish), CloudConfig (Unless you are using any Adobe Cloud config setting), Tracker (Unless you are using impression feature). If your base template is extension of CQ OOTB page template then there would be some more client lib, but those might be required. 

 

Also make sure that your static files are minimized and you are using Browser cache feature as well through Expiration.

Yogesh

View solution in original post

5 Replies

Avatar

Level 8

Which version of CQ are you running, and which files are you seeing loaded from /libs? 

In 5.6 the only reference to /libs that I know of in publish mode (as opposed to author mode where there will always be a bunch of stuff referenced from /libs) is the stats tracker JS - /libs/wcm/stats/tracker.js. That's included by /libs/foundation/components/page/stats.jsp which is included by the /libs/foundation/components/page/head.jsp. You can override stats.jsp are remove the reference to tracker.js if you aren't using the CQ impressions tracker. You can also just not include stats.jsp in your head.jsp if you aren't using either the impression tracker or the mvt stats tracker functionality. 

In the more current versions one of the components which does load number of JS files (although I don't think any of them come directly from /libs) is the servicecomponents component (/libs/cq/cloudserviceconfigs/components/servicecomponents) which is required to enable the various cloud services integrations (Site Catalyst, Target, etc). Also the client context component - /libs/cq/personalization/components/clientcontext which loaded by body.jsp also includes a number of client libraries. Including both of these is pretty crucial to core behavior in AEM and I'd be reluctant to disable them unless you were certain your weren't using anything that depends on them (and there are quite a few things that do depend on them). 

Avatar

Level 1

Hi,

The problem is solved we were including script head.jsp and clientlib cq.wcm.edit in all the components in all the pages and now we are controlling these files to include just in author with cq wcm mode.

Thanks 

Avatar

Level 10

Why are you avoiding the use of ClientLibs? That is the preferred way to organize your JS lib files (and CSS files) when working in CQ.

Avatar

Level 1

We are not avoiding the ClientLibs folder we have all our required js files in that folder but its about the /Libs folder which has all the subfolders like commerce, cq, dam/components/scene7, mcm, media/publishing these folders have bunch of js files which we are not using. Attached the screenshot of the folders. Thanks for your reply.

Avatar

Correct answer by
Level 5

Srikanth,

Is it Author Or Publish ? I guess instead of removing from dispatcher (Which will give 404 any way), you should find out what all components are using those include and remove those component instead if not needed.

Some of non required one are, ClientContext (If you are not using personalization), Timing component (Unless you want to find component load time in publish), CloudConfig (Unless you are using any Adobe Cloud config setting), Tracker (Unless you are using impression feature). If your base template is extension of CQ OOTB page template then there would be some more client lib, but those might be required. 

 

Also make sure that your static files are minimized and you are using Browser cache feature as well through Expiration.

Yogesh