Does CQ clears /var cache automatically on package deployment | Community
Skip to main content
Level 4
October 16, 2015
Solved

Does CQ clears /var cache automatically on package deployment

  • October 16, 2015
  • 2 replies
  • 2184 views

Hi all,

       Wanted to check on this. We are doing clientlib & JSP deployment on CQ server. To be on safer side we delete the /var cache directory in CQ  - Is this absolutely neccessary to clear /var cache or does CQ has any mechanism  where-in it detects that there is new version of file on the server so it will rebuilt the cache.

       Below are the 2 directories which we delete

        /var/classes/org/apache/jsp/apps

        /var/clientlibs

        Is there any special setting in CQ to enable this automated cache re-build after deployment ?   I   

       Thanks in advance.

        Rohit

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Yogesh_Upadhyay

Rohit,

Cache get rebuild based on update on actual file. If jsp on a package get updated, then corresponding class file under /var/classes also get updated upon next request. Same goes true for clientlib as well. To force recompilation you can restart Apache Sling Scripting JSP Supportorg.apache.sling.scripting.jsp bundle from felix console for jsp and Adobe Granite UI Commonscom.day.cq.cq-widgets) for clientlib.

You can also do something like http://HOST:PORT/system/console/slingjsp in CQ6 for force recompilation as well (Can do it through CURL)

But these steps should not be required, If you have to do that, That means there is some bug and you should report it.

Yogesh

2 replies

Yogesh_Upadhyay
Yogesh_UpadhyayAccepted solution
Level 6
October 16, 2015

Rohit,

Cache get rebuild based on update on actual file. If jsp on a package get updated, then corresponding class file under /var/classes also get updated upon next request. Same goes true for clientlib as well. To force recompilation you can restart Apache Sling Scripting JSP Supportorg.apache.sling.scripting.jsp bundle from felix console for jsp and Adobe Granite UI Commonscom.day.cq.cq-widgets) for clientlib.

You can also do something like http://HOST:PORT/system/console/slingjsp in CQ6 for force recompilation as well (Can do it through CURL)

But these steps should not be required, If you have to do that, That means there is some bug and you should report it.

Yogesh

OldOldOld
Level 2
October 16, 2015

There was a bug in 5.4 where this did not work, but in more recent versions I think it should work.

There may be a case of some weird includes or circular references, but then you need to give more details.

Also check the files in your code packages, is there something that changes with each deployment, like a version number in the comments? This could trigger a lot of recompiles potentially and may result in problems, see above.

If you really want to force cleaning it with every deployment, you can just add an empty /var/classes folder to your code package.