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: https://docs.adobe.com/docs/en/aem/6-1/administer/security/cug.html

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

Learning

  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 {
        # www.mysite.com
        # www.mysite.com/path/for/secure/pages 01
        # www.mysite.com/path/for/secure/pages 02
    }
  4. If you have multiple hierarchy of secure pages in site, make sure to define all hierarchy in /virtualhosts section
Reference:
  1. https://docs.adobe.com/docs/en/aem/6-1/administer/security/cug.html
  2. https://docs.adobe.com/docs/en/dispatcher/disp-config.html
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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