AEM · Dispatcher

AEM | CUG | Dispatcher configuration to cache secure pages

While configuring Dispatcher for some secure pages (defined using CUG), i faced challenges to configure dispatcher, so documenting my finding below:

Scenario: I am using AEM login functionality, With CUG enabled page protection, and using Dispatcher to cache my pages. I want to cache my secure and non-secure pages on dispatcher, but also want secure pages to be accessible to authenticated user only.

I followed following document:

Problem: My secure pages are not getting cached on dispatcher. When i configure allowAuthorized as 0, my secure pages get cached but not non-secure pages.

Solution: What i missed is to create multiple farms for same site. Basically we need to create two farm for same site. One is for secure (logged in state) and another for normal state.

  1. Normal state farm wont have authorize flag
  2. Secure state farm will have authorize flag and session configuration
  3. Both farms will have separate cache folder


  1. We can have multiple farms for same site.
  2. Each farm will entertain same domain, so we need to correctly configure /virtualhosts section of farm  to identify secure pages.
  3. /virtualhosts section can have relative path of same site. eg.
    /virtualhosts {
        # 01
        # 02
  4. If you have multiple hierarchy of secure pages in site, make sure to define all hierarchy in /virtualhosts section

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s