CQ5 Gotchya: Client Libraries Not Automatically Refreshing

I’ve noticed that sometimes when I update my javascript client libraries (under /etc/designs/my_project/clientlibs), the changes are not always automatically reflected when I refresh my webpage to test. One way around this is to clear your browser cache after making a change, but depending on the situation, that might mean logging into either CQ5 again or your even the website you’re working on in order to test the changes.

What I found is that if you make a change to the js.txt file in your client library and save it again, then the changes in the actual javascript file you’re working on are picked up.

For example, I have the following js.txt in my clientlibs_main (cq:ClientLibraryFolder) folder:


and my actual javascript functions are in the file /etc/designs/my_project/clientlibs/js/my_client_javascript.js. When I make changes in my_client_javascript.js, these aren’t always reflected in the website after saving. But after making my change, if I edit js.txt (I generally delete and re-add the ‘s’ at the end of the line ‘js/my_client_javascript.js’), and save THIS file as well, the changes are reflected in the website without the need for clearing the browser cache.

This entry was posted in AEM, CQ5 and tagged , , , , . Bookmark the permalink.

1 Response to CQ5 Gotchya: Client Libraries Not Automatically Refreshing

  1. Pingback: CQ5 Gotchya: Client Libraries Not Automatically Refreshing – Part 2 | Code Monkey

Add a comment...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s