Category Archives: aem

What are the best way of handling AEM caching in dispatcher?

I recently came across situation where I need to clear my dispatcher cache manually. For instance, If I am modifying any Js/css files, I would need to clear my dispatcher cache manually in order to get those modified new Js/css else it would be serving the old version of code. I just heard that ACS developed version clientlib which will help us do versioning. I have so many question on this.

Before version clientlib how did AEM manage? Doesn't AEM has intelligent to manage versioned clientlibs? Is it correct of way of handling it? Can we create a Script whil will take back up of the existing before clearing those JS/css files? What are the other options we have?

How to configure Dispatcher flush replication agent and farm files for multiple domains having webpages in single AEM instance

I have a website running on AEM server. The requirement is to launch a new website. So I created new farm files and added a new virtual host. I have problem with caching. So the root directory is /mnt/var/www/html. To separate two domains, created two sub directories as /mnt/var/www/html/domainA and /mnt/.../domainB. Some pages are caching in wrong directory meaning domain A pages to domain B pages. Meaning hitting one of the other farm files.

There is only one default flush agent in publish configured with IP. So I thought to rename the existing default flush agent with domain A(instead of IP). Also create a new agent for domain B(http://domainname:80/dispatcher/invalidate.cache) But this agent is failing saying domain not found 404.

Please share your knowledge if I'm missing anything or configuring it wrong.

Redirect rule in Apache Server for two different servers

I've two different servers - Server A and Server B.

Server A has a application

Server B has a application

My need is to redirect to

I have assigned CNAME (Canonical Name) to as, so currently whenever I hit it opens the content of although it is not redirected yet.

What Redirect Rule I need to define in Apache server of 'Server B' so that request coming from from 'Server A' is redirected to including the path '/abc'


How to set CQ/AEM behind apache with a rewrite url

I'm trying to set apache to rewrite anything going to http://mytest.test.cq/MySite/ to an AEM instance running on another system through a rewrite rule.

this is the virtual

<VirtualHost mytest.test.cq:80>
    ServerName mytest.test.cq
    documentRoot "C:/www"
    <Directory "C:/www">
        Allow from all

    RewriteEngine on    
    RewriteRule "^/MySite/(.*)" "http://my.cq.ip:4903/$1" [P]

if I try to go to http://mytest.test.cq/MySite/ it does go to my AEM instance, but AEM redirect to http://mytest.test.cq/libs/granite/core/content/login.html instead. if I write http://mytest.test.cq/MySite/libs/granite/core/content/login.html I get the login screen, if I log in it then removed MySite again.

I thought this would be an Externalizer issue, so I configured them, but the problem persists. I've been scouring adobe's documentation without luck on a solution.

Using a cookie header to enable piloting a site via the AEM apache dispatcher

We are trying to allow our business users to be able to verify a new site's production look and feel as well as to allow a select group of internal users to be able to view new sites that are authored and created in AEM.

One idea, is to set up a Launch Page that the general public would see, and for the pilot group, they would set a cookie in their browser to be able to see the pilot site.

We have looked into VHosts settings, but can't spot anything, and are thinking perhaps a conditional pass through rule based on the cookie in the header as being the easiest approach?

Any thoughts would be greatly appreciated.

File path cached in dispatcher and rendering a 403 when a sub-set of the file path is requested

We have rules in the dispatcher saying not to cache a .pdf, but allows .png. One of the .pdf files have a .png thumbnail renditions, making the path /content/a/b/c.pdf/r/s/t.png in the jcr tree structure cacheable.

When user tries to reach the /a/b/c.pdf apache returns a 403 - forbidden status code. The path is valid in the AEM app server

I would still like to maintain image caching and resolve the 403.

Any suggestions/ideas?