Mandeep
Mandeep

Reputation: 65

How can I turn off caching CSS, in Adobe CQ 5

Adobe CQ is caching my css for a component I am building. I created a clientlibs folder to add the CSS to the component. Next, I'm using the

<cq:includeClientLib categories="includes" />

tag to include the CSS in my jsp.

How can I disable caching, the CSS in CQ. (I've already cleared the browser cache, it is not a browser cache issue).

Upvotes: 0

Views: 5195

Answers (4)

Suren Konathala
Suren Konathala

Reputation: 3597

Below is how to do this on AEM 6.1

On AEM-Author you can enable the "Dispatcher Flush" agent to invalidate cache on AEM-publish instance.

The URI will be something like this: http://txpubt01:80/dispatcher/invalidate.cache

Where "txpubt01" is Publish instance server; "80" is the port where Apache is running on "txpubt01 server".

Main page to manage replication agents

Agents on Author

Dispatcher Flush

Upvotes: 0

George
George

Reputation: 6104

These are just 2 common ways I clear server cache. Hope it helps someone.

Dispatcher Flush


Navigate to http://yourdomain.com:4502/etc/replication/agents.author/flush.html and click on Test Connection.

Invalidating Dispatcher Cache (source)


  1. Open the AEM Tools console. (http://yourdomain.com:4502/miscadmin#/etc)

  2. Open the required replication agent below Tools/replication/Agents on author. You can use the Dispatcher Flush agent that is installed by default.

  3. Click Edit, and in the Settings tab ensure that Enabled is selected.

  4. On the Transport tab, enter the URI needed to access Dispatcher. If you are using the standard Dispatcher Flush agent you will probably need to update the hostname and port; for example, http://:/dispatcher/invalidate.cache

    Click OK to activate the agent.

Upvotes: 3

Fernando Cea
Fernando Cea

Reputation: 267

If you're using CQ5 with LESS (which is already included), in the Developer console you can execute this:

localStorage.clear()

this will remove your LESS cache.

Upvotes: 1

Noco
Noco

Reputation: 1747

To disable clientlib mechanism, navigate to felix console yourhost:port/system/console/configMgr

Search for "HTML Library Manager" Check "Debug" and save.

Now all CSS an JS assets are served as single files. Also, all caches are invalidated. Request your page once and switch off "Debug" mode when you are done.

That helps with cached files most of the time. I don't recommend this for production system!

In case you compile your clientlibs through "embed" statements within other clientlibs, edit the css.txt file and append a commented-line. Also remove cached clientlibs below var/clientlibs/etc

Upvotes: 1

Related Questions