Dispatcher is Adobe Experience Manager's caching and/or load balancing tool. Dispatcher also helps to protect your AEM server from attack.
The Dispatcher helps realize an environment i.e both fast and dynamic. It works as a part of a static HTML server, with the aim of :
Note: For more on Dispatcher watch this video
Dispatcher is Adobe Experience Manager's caching and/or load balancing tool. Dispatcher also helps to protect your AEM server from attack.
The Dispatcher helps realize an environment i.e both fast and dynamic. It works as a part of a static HTML server, with the aim of :
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.
The Dispatcher uses the web server's ability to serve static content. The Dispatcher stores cached documents in the web server’s document root. The Dispatcher has two primary methods for updating the cache content when changes are made to the website.
Load Balancing distributes user requests (load) across different clustered CQ instances.The following list describes the advantages for load balancing:
The /statfile property identifies the file to use as the statfile. Dispatcher uses this file to register the time of the most recent content update. The statfile can be any file on the web server.
The statfile has no content. When content is updated, Dispatcher updates the timestamp. The default statfile is named .stat and is stored in the docroot. Dispatcher blocks access to the statfile. Example:
By default the Dispatcher configuration is stored in the dispatcher.any text file, though you can change the name and location of this file during installation.
The configuration file contains a series of single-valued or multi-valued properties that control the behavior of Dispatcher:
By default the following requests are not cached by dispatcher
The Dispatcher filter can be used to allow or deny external access to specific areas of AEM. To protect our instance we should configure the Dispatcher to restrict external access as far as possible. First we should deny access to all files and then allow/deny access to specific areas. Example
We can define whether the Dispatcher caches a document by using the Dispatcher configuration file, dispatcher.any. The Dispatcher checks the request against the list of cacheable documents. If the document is not in this list, the Dispatcher requests the document from the AEM instance. The Dispatcher always requests the document directly from the AEM instance in the following cases:
The Dispatcher stores cached files on the web server as if they were part of a static website. If a user requests a cached document, the Dispatcher checks whether the document exists in the web server's file system. If so, the Dispatcher returns the documents. If not, the Dispatcher requests the document from the AEM instance.
Yes. For example, if you want to cache only GIF files, specify *.gif in the cache section of the dispatcher.any configuration file.
Yes. In such cases, ensure that both the Dispatchers can access the CQ website directly. A Dispatcher cannot handle requests coming from another Dispatcher.
Yes, if the machine is sufficiently powerful. However, it is recommended that you set up the Dispatcher and the AEM Publish instance on different machines.
For most pages that use sticky connections, you should turn off caching. Otherwise, the same instance of the page is displayed to all users, regardless of the session content.
For some applications, it can be possible to use both sticky connections and caching. For example, if you display a form that writes data to a session, you can use sticky connections and caching in tandem.
Yes we can. But it is very bad idea.
Yes, We can have Dispatcher for AEM author instance.
We can delete files from the CQ cache by using an HTTP request. When the HTTP request is received, Dispatcher deletes the files from the cache. Dispatcher caches the files again only when it receives a client request for the page. Deleting cached files in this manner is appropriate for web sites that are not likely to receive simultaneous requests for the same page.
The HTTP request has the following syntax:
POST /dispatcher/invalidate.cache HTTP/1.1Dispatcher deletes the cached files and folders that have names that match the value of the CQ-Handle header. For example, a CQ-Handle of /content/geomtrixx-outdoors/en matches the following items:
Sling Dynamic Include (SDI) is an OSGi service that is able to automatically replace configured components with the include tags. we can enter list of components (using their resource types) into SDI configuration, choose the include tag type (SSI, ESI or AJAX) and SDI will do the rest. It's totally transparent, we can use it with any components and developers don't have to write any code related to the includes. Every configuration change is seen immediately in the page content. we can enable it only on production machines or on the publish instances, etc. more
We configure caching behavior inside /cache property. Inside /rules property, we can mention the list of cacheable documents.
We configure caching behavior inside /cache property. Inside /invalidate property, we can mention the list of documents which are subject to auto-invalidation.
The /renders property defines the URL to which Dispatcher sends requests to render a document. The following example /renders section distributes render requests equally among two AEM instances: