AEM 6 Dispatcher configuration
There are two main usage of dispatcher.
1. Load balancing
2. Cache management
Following are the main AEM 6 dispatcher configurations required for cache management that one must have in mind while configuring dispatcher.any file.
First thing is /name which specifies the name of configuration. Once can select whichever name makes most sense according to the environment in which this is configured.
After /name there should be /farms defined. All the other dispatcher related configurations go inside this one as follows.
/farms
{
/website
{
/clientheaders
{
}
/virtualhosts
{
}
/sessionmanagement
{
}
/renders
{
}
/filter
{
}
/vanity-urls
{
}
/cache
{
/rules
{
}
/invalidate
{
}
}
/statistics
{
/categories
{
}
}
/stickyConnectionsFor
/health_check
{
}
/retryDelay
/numberOfRetries
/unavailablePenalty
/failover
}
}
- Here /website can be any label like /mysite /abcxyz. This just defines the block of configuration that will be applied on a site.
- Inside /clientheaders one can define the pages headers those should be allowed to be accessed.
- Inside /virtualhosts one can define for which all virtual hosts the dispatcher can render the pages.
- Inside /sessionmanagement has sub sections like /directory which specifies where the session management details should be stored. /encode that defines how to encode the details. /header is the cookie/header that contains the authorization details and /timeout that specifies the session timeout.
- /renders specifies which ip/host and port should be used for rendering the pages. i.e. publish ip/host and port number. There can be multiple entries defined here.
- /filter specifies which kind of requests/pages should be filtered for rendering. This also uses details like /url, /protocol, /method, /extension, /path, /selectors, /suffix as more configuration options.
- /vanity_urls can be configured to allow access to vanity urls. Here /file specifies the file where dispatcher keeps the list of vanity urls.
- /cache is the main configuration that has information on how the cache will be handled by dispatcher. It has 11 subsections. /docroot, /statfile, /statfileslevel, /rules, /invalidate, /allowAuthorized, /serverStaleOnError, /invalidateHandlers, /allowClients, /ignoreURLParams, /headers.
- /docroot specifies where the cache files will be stored.
- /statfile specifies the name of stat file to be used.
- /statfileslevel spefies the level of content hierarchy until which the statfile should be created. /rules specifies which files should be cached.
- /invalidate specifies which files should be eligible for the automatic invalidation.
- /allowAuthorized specifies if pages authorization headers should be cached.
- /serverStaleOnError says if the dispatcher should return stale pages when the server returns error.
- /invalidateHandlers allows to configure script that can be used when dispatcher invalidation is called.
- /allowClients specifies which clients are allowed to flush the cache.
- /ignoreUrlParams specifies which url parameters should be ignored which caching the pages.
- /headers allows you to define pages with which all headers should be cached by dispatcher.
- /statistics allows you to define categories to be used for rendering the pages along with their statistics created by dispatcher. This allows only first 8 categories to be considered by dispatcher while rendering the pages from categories. Categories can be anything from html pages to scripts.
- /stickyConnectionsFor is used to define for which pages sticky connections should be used. Sticky connections are the connections those require the requests to be served by the same publish instance for the same user. For example customer accounts page.
- /health_check specifies the page that should be accessed while a 500 error occurs. If the specifies page also returns 500 error, then the configurable time penalty is applied before retrying.
- /retryDelay specifies the time in seconds before there is retry for the server access.
- /numberOfRetries number of retry performed by dispatcher for the renders.
- /unavailablePenalty specifies the time delay before a retry is attempted by dispatcher.
- /failOver this enables the dispatcher to divert the request to another server in case the number of retries fails for one.
No comments:
Post a Comment