简体   繁体   中英

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).

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.

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

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.

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".

管理复制代理的主页

代理人

分派冲洗

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM