March 21, 2020
Estimated Post Reading Time ~

What is a Dispatcher and it's importance

Dispatcher
The dispatcher is a caching and load balancing tool for AEM.
Dispatcher acts as a firewall and helps to protect the site from vulnerable attacks.
The dispatcher is used in conjunction with a standard web server.


Why Caching & when caching does not work?
Any site performs well when it is served from a cache. Except dynamic data, everything else is recommended to be cached. There are cases where the caching does not work. For eg, get() request, when query parameters are available or no extension, response.setHeader("Dispatcher", "no-cache"), authentication header/cookie or any other cases where the dispatcher rules are not satisfied.

Better ways of serving dynamic content?

While AEM site implementation, the main aim would be caching all site content. When there are content to be served dynamically, we have to serve them through RESTFul service (Page Layout is still cached).

Dispatcher Vs CDN

CDN (Content Delivery Network) is globally distributed and serves requests across balanced regions. But AEM Dispatcher resides with AEM and not globally distributed.

Cache invalidation from dispatcher
Below mentioned methods are common in invalidating cache from dispatcher.

From authoring
A replication agent is configured on the AEM author instance, which sends a cache invalidation request to Dispatcher when a new page is published. This invalidates the cache from authoring environment.

From publishing
In this scenario, the publishing environment sends a cache invalidation request to Dispatcher when a published page is received.

Manual
There are cases when dispatcher cache needs to be invalidated without activation of a page. In such cases, we can issue an HTTP request to the dispatcher. The HTTP request deletes specific files from the Dispatcher cache.



By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.