Published on

AEM Dispatcher Series 8 - Top 15 Interview Questions

Authors

If you’ve read through the previous posts, you now understand Dispatcher from caching, security, and session management to vanity URLs and debugging.

In this post, we’ll compile the Top 15 AEM Dispatcher questions that developers are likely to encounter in interviews — along with clear, concise answers from a practical perspective.


1. What are the two main purposes of the AEM Dispatcher?

Answer:

  1. Caching: Improves site performance by serving static copies of pages.
  2. Security/Filtering: Blocks access to sensitive paths (e.g., /crx/de, /system/console) and ensures only allowed requests reach Publish.

2. Explain the cache invalidation process. What is the .stat file?

Answer:

  • When content is activated in AEM, the Flush Agent sends a request to Dispatcher.
  • Dispatcher touches a .stat file — a timestamp marker for cached folders.
  • Any cached file older than the .stat file is considered stale and re-fetched on the next request.

3. What is /statfileslevel and why is it important for performance?

Answer:

  • /statfileslevel defines the folder depth at which .stat files are created.
  • Higher levels allow granular invalidation — only affected site sections are refreshed, reducing unnecessary cache rebuilds.
  • Too low → broad invalidation, slower site.
  • Too high → some updates may not invalidate properly.

4. How would you prevent a specific component’s JSON data from being cached?

Answer: Use /cache/rules in dispatcher.any:

/rules {
  /0000 { /glob "*.html" /type "allow" }
  /0001 { /glob "*.user.json" /type "deny" }
}

This ensures user-specific or personalized JSON is always fetched from Publish.


5. What’s the difference between a /filter rule and a /cache rule?

Answer:

  • /filter controls which URLs are allowed or denied to reach AEM Publish (security).
  • /cache rules control which files are stored in Dispatcher cache and how they’re invalidated (performance).

6. How do you debug an issue where a user sees stale content?

Answer: Check:

  1. .stat file timestamp vs. cached files.
  2. Flush Agent configuration and /allowedClients.
  3. Cache rules in /cache/rules.
  4. Dispatcher logs for invalidation entries.

7. Explain how you would configure Dispatcher to allow a new vanity URL.

Answer:

  1. Define the vanity path in AEM Page Properties.
  2. Update Apache mod_rewrite to map the vanity path to the actual page.
  3. Ensure /filter rules allow the rewritten URL.
  4. Verify caching behavior (/cache/rules) is appropriate.

Example rewrite:

RewriteRule ^/my-product$ /content/mysite/en/products/my-product.html [PT,L]

8. What is session management (/sessionmanagement) in the Dispatcher?

Answer:

  • Ensures authenticated users see only their own content.
  • Dispatcher keeps session info in /directory and can encode IDs (e.g., md5).
  • Combined with /cache/rules, it prevents caching of private or personalized responses.

9. What are “permission-sensitive” nodes, and how does Dispatcher handle them?

Answer:

  • Nodes like /content/user-data may have sensitive data.
  • Dispatcher should deny caching and use /filter rules to block unauthorized access.
  • Personalized content should bypass caching entirely.

10. How do clientheaders work?

Answer:

  • /clientheaders lists HTTP headers that Dispatcher forwards to AEM Publish.
  • Useful for headers like Authorization, Referer, Cookie, or custom headers for personalization.
  • Missing headers can break AEM logic or personalization.

11. How does Dispatcher handle multiple Publish instances?

Answer:

  • Defined in /renders section.
  • Dispatcher performs load balancing: it forwards requests to available instances.
  • Sticky connections can be configured for session-based traffic.

12. How do you test if a path is allowed or blocked by Dispatcher?

Answer:

  • Use curl:
curl -I http://dispatcher.mysite.com/bin/my-servlet
  • Check dispatcher.log for denied or allowed messages.

13. How do you debug 403, 404, or 500 errors?

Answer:

  • 403: Check /filter rules.
  • 404: Verify resource exists on Publish, /filter rules, and rewrite rules.
  • 500: Check Publish server health (/renders) and Dispatcher connectivity.

14. How does /ignoreUrlParams affect caching?

Answer:

  • Dispatcher treats URLs with query parameters as separate cache entries by default.
  • /ignoreUrlParams allows ignoring certain parameters (like utm_source) to avoid cache duplication.

15. How can you manually test cache invalidation?

Answer:

  1. Check .stat file timestamps.
  2. Touch the .stat file to force invalidation:
touch /opt/dispatcher/cache/content/mysite/en/.stat
  1. Make a request to verify the new content is served.
  2. Check dispatcher.log to confirm invalidation.