Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

Programatically building dispatcher cache without sending request via browser.

Avatar

Level 2

Hi, Can I programtically build dispatcher cache without hitting out the browser ? I know I can invalidate the cache programatically by sending an http request. How about building the dispatcher cache for my required folder and subfolders without sending requests via browser ? i am using AEM 5.6.1 and Apache 2.2

 

Thanks
Sanjoy

1 Accepted Solution

Avatar

Correct answer by
Level 8

Dispatcher by it's nature is not intended to have a prebuilt cache. That said in theory you could do the following:

  1. Configure a Static Replication Agent - see this blog post about the static agent - there isn't a lot of documentation - http://www.wemblog.com/2012/02/how-to-use-static-agent-in-cq-wem.html. You might have to do this on a publish server in order to get the right link rewriting and link checking, and trigger for chain replication after a normal replication to publish. That's a guess though since I have never used the static agent. 
  2. Write a script that watches the target of your static agent and then transfers the new files to you web server. 
  3. Turn off Dispatcher cache flushing

There are probably several holes in that approach that you'll have to fix - for example how to handle a deactivation/deletion - I don't believe the static agent handles that. Also if you are doing any interesting JavaScript on you pages that create JSON or unusual image/file selectors you may have to write custom extensions of the static agent. I have never seen anyone actually do this so I can't speak to how many holes there might be in the process. 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 8

Dispatcher by it's nature is not intended to have a prebuilt cache. That said in theory you could do the following:

  1. Configure a Static Replication Agent - see this blog post about the static agent - there isn't a lot of documentation - http://www.wemblog.com/2012/02/how-to-use-static-agent-in-cq-wem.html. You might have to do this on a publish server in order to get the right link rewriting and link checking, and trigger for chain replication after a normal replication to publish. That's a guess though since I have never used the static agent. 
  2. Write a script that watches the target of your static agent and then transfers the new files to you web server. 
  3. Turn off Dispatcher cache flushing

There are probably several holes in that approach that you'll have to fix - for example how to handle a deactivation/deletion - I don't believe the static agent handles that. Also if you are doing any interesting JavaScript on you pages that create JSON or unusual image/file selectors you may have to write custom extensions of the static agent. I have never seen anyone actually do this so I can't speak to how many holes there might be in the process.