How to find out what does dispatcher cache?

2019-03-04 15:53发布

问题:

According this link

Dispatcher is Adobe Experience Manager's caching and/or load balancing tool.

I need to know what does my dispatcher cache.
How can I found out it?

回答1:

The Adobe AEM/CQ5 dispatcher simply takes the response body from requests made into the CQ5 instances and saves them as files that then the httpd can deliver. The dispatcher can be configured to allow requests to be either cached or sent directly to the CQ5 instance. This configuration is done in a file dispatcher.any. Check the documentation, it is good enough.

In general you decide what is cached and what not by defining a set of rules. "allow" means to cache and "deny" not to cache. For example:

/rules
{
  /0000  { /glob "*" /type "allow" }
  /0001  { /glob "/en/news/*" /type "deny" }
  /0002  { /glob "*/private/*" /type "deny"  }   
 }

Will:

  • by default cache every request (rule 0000)
  • send to the instance requests to that contain "/en/news/" and "/private/*" (rules 0001 and 0002).

The documentation also describe how to write these rules.

Finally, the dispatcher will never cache requests without extension, requests with a query string, non-GET requests and requests with an authentication header.



回答2:

From this link: http://docs.adobe.com/docs/en/dispatcher.html

"The Cache Directory For caching, the Dispatcher module uses the web server's ability to serve static content. The Dispatcher places the cached documents in the document root of the web server."

So the exact location will depend on how you have your web server configured. I am assuming you have set up a web server such as Apache and installed the dispatcher module correctly. This is a seperate piece of software from the AEM/CQ5 jar.

The dispatcher will cache anything allowed by the dispatcher rules. HOWEVER, requests with a query string will bypass dispatcher. Which means:

http://www.yourserver.com/mypage.html will be cached

http://www.yourserver.com/mypage.html?someQuery=true will not be cached.

The second request will bypass dispatcher even if a file has been cached for that URL.

Sling selectors however will be cached, so this will work: http://www.yourserver.com/mypage.myselector.html will be cached

Another important note (sometimes): the HTTP headers are NOT cached. Just the final HTML. This can really matter for some applications.



回答3:

you need to see into dispatcher.any file in section renders/cache