In CQ, the Dispatcher is Adobe's caching and load-balancing tool. The caching options in CQ are configured through the dispatcher.any configuration file. To allow for a robust caching mechanism, the Dispatcher.any file provides a number of configuration options. For a description of the  Dispatcher, see CQ Dispatcher documentation.

This article covers issues that you could face when you enable caching on a CQ instance using the Dispatcher.

Enable debugging on the Dispatcher

When you configure the CQ Dispatcher, ensure that the Dispatcher logged mechanism is in place.

For the Apache web server, ensure that the following lines are in the http.conf file:

<IfModule disp_apache2.c>
DispatcherConfig conf/dispatcher.any
DispatcherLog logs/dispatcher.log

# log level for the dispatc her log
# 0 Errors
# 1 Warnings
# 2 lnfos
# 3 Debug
DispatcherLogLevel 3

# if turned to 1, the dispatcher looks like a normal module
#since build 5210, this setting has no eff ect , since it used to crash
# apache if set to 0.
DispatcherNoServerHeader 1

# if turned to 1, request to I are not handled by the dispatcher
# use the mod_alias t hen for the correct mapping
DispatcherDeclineRoot 0

The line, DispatcherLog logs/dispatcher.log indicates the name of the Dispatcher log file.

The line, DispatcherLogLevel 3 indicates the level of messages to log.

As soon as you restart the web server, the dispatcher.log file is created with information regarding the initialization of the Dispatcher.

You can change the name and location of the log file with respect to the web server root directory.

With the Dispatcher caching enabled, browse to any page on your CQ website, then open the dispatcher.log. You see the following lines:

[Tue Oct 16 13:14:04 2012] [D] [1376(1532)] cachefile does not exist or is a directory: \Library\WebServer\cache\index.html
[Tue Oct 16 13:14:04 2012] [D] [1376(1532)] try to create new cachefile: \Library\WebServer\cache\index.html
[Tue Oct 16 13:14:04 2012] [D] [1376(1532)] cache-action for [/index.html]: CREATE


The cache-action statement in the log file is an indicator that you can use to identify the result of the last page call.


How do I debug a problem where no content is saving in the Dispatcher cache?

The web server page data is cached to the location specified in the /docroot attribute of the /cache section in the dispatcher.any. When you identify that the specific page information is not getting cached, go the dispatcher.log. At the end of the log are entries for the last page call.

Error "Caching disabled due to query string" found in log

[Tue Oct 16 13:14:04 2012] [D] [1376(1532)] checking [/libs/cq/security/userinfo.json]
[Tue Oct 16 13:14:04 2012] [D] [1376(1532)] Caching disabled due to query string: cq_ck=1350373444666
[Tue Oct 16 13:14:04 2012] [D] [1376(1532)] cache-action for [/libs/cq/security/userinfo.json]: NONE

Requests that contain a query string (such as lead to dynamic output that depends on the query string. In most cases, the output of query string request should not be cached.


If you determine that some query parameters do not directly relate to the output, configure the Dispatcher to ignore the request's query string parameters.

In the ignoreUrlParams section, specify query string parameters to ignore.

In this example configuration, URL requests with the "q" query string parameter are cached.

 /0001 { /glob "*" /type "deny" }
 /0002 { /glob "q" /type "allow" }

For the above configuration, the dispatcher treats the following requests as identical.

Error "no cache due to authorization header" found in log

[Tue Oct 16 13:39:17 2012] [D] [1376(1532)] checking [/content/geometrixx-outdoors/en/unlimited-blog.html]
[Tue Oct 16 13:39:17 2012] [D] [1376(1532)] no cache due to authorization header.
[Tue Oct 16 13:39:17 2012] [D] [1376(1532)] cache-action for [/content/geometrixx-outdoors/en/unlimited-blog.html]: NONE


See the following forum discussion for a resolution of this issue: Dispatcher serving, but not caching, CQ5 pages

How do I debug cache files not getting updated?

The CQ caching mechanism updates the timestamp of an empty file (specified by the /statfile attribute in dispatcher.log) to invalidate the cache. So when a page is replicated, the Dispatcher Flush agent sends a request to the Web server. The Dispatcher recognizes the request and opens the .stat file. Then, it changes 1 byte in the file to update the timestamp. This change invalidates the cache and causes Dispatcher to flush the cache.


How do I debug if nothing is working at all?

You could encounter a scenario when your websites displays only blank pages.

Error "Filter rejects" found in log

[Tue Oct 16 13:47:18 2012] [D] [2880(1332)] cache-action for [/libs/wcm/core/content/siteadmin.infinity.json]: NONE
[Tue Oct 16 13:47:18 2012] [D] [2880(1532)] connected to render publish1 (
[Tue Oct 16 13:47:18 2012] [D] [2880(1332)] Filter rejects GET /libs/wcm/core/content/siteadmin.infinity.json HTTP/1.1


The filter section of the dispatcher.any defines the requests that the Dispatcher handles.

Ensure that the /type is set to "allow" for pages and content of the website to be made available for view.

In the above example, the error is thrown for the "siteadmin.infinity.json."

For the following lines from the /filters section of the dispatcher.any the type is set to "deny"

      # Deny content grabbing
      /0081 { /type "deny"  /glob "GET *.infinity.json*" }
      /0082 { /type "deny"  /glob "GET *.tidy.json*"     }
      /0083 { /type "deny"  /glob "GET *.sysview.xml*"   }
      /0084 { /type "deny"  /glob "GET *.docview.json*"  }
      /0085 { /type "deny"  /glob "GET *.docview.xml*"  }