So client libaries are stored and cached in cq in /var/clientlibs.
Is there any way to serve these files from that directory?
For example we have client libraries with our components in our apps directory. Currently using client libraries we are including them from the place the components lives for example if i create a component under
/apps/test/myComponent
I then create a client library for this and place the client library include in my jsp.
CQ will cache this for me under /var/clientlibs/ but it will still serve them from the apps directory. Is there a way to make this be served from teh var directory instead in my html so it won't be blocked by the dispatcher?
Thanks in advance!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
The correct way to handle that situation is to create a clientlib under /etc which embeds the clientlib under /apps.
Views
Replies
Total Likes
Hi,
The correct way to handle that situation is to create a clientlib under /etc which embeds the clientlib under /apps.
Views
Replies
Total Likes
Hi! Thanks for replying!
I understand totally what you are saying and I understand that concept. My problem is that we have a large number of applications and if we embed them in client library categories in our etc folder then we will get more css and js than we really need or we would have to create a client library for every one of the components we have that has css and js that must be isolated to that component (for example have a single page with one component on it). Is there any way to serve them from the /var/client libs at all?
Views
Replies
Total Likes
Hi,
It sounds like you've overengineered this a bit. Your are better off (both in CQ and in general) serving fewer JS/CSS files, even if those files contain rules which don't apply on specific pages. If you're using minification and gzipping (which you should be), the additional rules/code are trivial in length compared to the network roundtrip of fetching them separately. Most of the time, my projects use a single end-user facing client library (which might embed some other libraries of course). It is the relatively rare case where a separate library is necessary. Of course, every project is different, so YMMV.
So I would create one library in /etc which embeds all the other libraries. And then just reference that library in your JSP code.
Justin
Views
Replies
Total Likes
Views
Replies
Total Likes