Core path ยท 1 of 34
Understanding the AEM request flow from browser to Dispatcher to Publish. Learn how caching works, why content updates don't appear immediately, and how to troubleshoot production issues like an architect.
In this chapter, you'll discover:
When we first start working with AEM, page rendering feels almost magical. A user opens a URL in the browser, and somehow AEM returns a fully rendered page.
Most developers learn how to create components, dialogs, Sling Models, and HTL templates very early in their AEM journey. However, very few spend time understanding what happens before any of those things even come into the picture.
In real-world projects, understanding the request flow is extremely important.
Whenever a page is slow, content is not updating, dispatcher cache behaves unexpectedly, or a page works on one environment but not in publish, the root cause is often hidden somewhere in the request processing pipeline.
Before we start learning about Resources, Sling Models, Resource Types, HTL, or Servlets, we need to understand the journey of a request.
By the end of this chapter, you should be able to explain where Dispatcher fits into the architecture, why caching matters, and how to approach common production issues before looking at component code.
If you remember only one thing from this chapter, remember this path:
Browser -> CDN (optional) -> Dispatcher -> AEM Publish -> Sling Rendering
When users report slow pages or stale content, the issue is often in one of these layers before component code is even involved.
Imagine a user opens the following URL
https://www.company.com/us/en/home.html
From the user's perspective, the process looks simple:
User โ Website โ Page Opens
But internally, several systems work together before the page appears in the browser.
A simplified production flow looks like this:
Browser
โ
Dispatcher
โ
AEM Publish
โ
Page Response
At first glance this seems straightforward, but each step plays an important role.
Before we dive into Dispatcher, caching, and Sling internals, let's look at the complete request flow at a high level.
The journey of a request from the browser to AEM Publish and back to the user involves multiple layers:

Understanding request flow is one of the first steps toward thinking like an AEM architect because it helps you understand not only how pages are rendered, but also how content is delivered, cached, secured, and troubleshooted in production environments.
Many developers spend months learning components, dialogs, Sling Models, and HTL before understanding how a request reaches those components in the first place.
The reality is that most production issues are not caused by component code.
They are caused by problems in:
Understanding the request path allows developers to troubleshoot issues much faster and communicate more effectively with DevOps, architects, and platform teams.
When a user enters a URL or clicks a link, the browser sends an HTTP request.
For example:
GET /us/en/home.html
This is called a GET request because the browser wants to retrieve information.
In most AEM websites, page rendering starts with a GET request.
The browser is essentially saying:
At this stage, the browser knows nothing about AEM, Sling Models, HTL, Components, Templates, or Resources. It simply wants a response.
In production environments, requests usually do not go directly to AEM Publish.
Instead, they first reach Dispatcher:
Browser
โ
Dispatcher
โ
Publish
Many new developers think Dispatcher is just a cache.
Caching is certainly one of its biggest responsibilities, but Dispatcher does much more than that.
It acts as:
Because Dispatcher sits in front of Publish, it helps protect AEM from unnecessary traffic.
Imagine a homepage that receives thousands of visits every hour.
Without caching, every request would reach AEM Publish:
1000 Requests โ 1000 Publish Renderings (Very Slow!)
This would create unnecessary load on the system and slow down response times.
Instead, Dispatcher can store previously generated responses and return them directly:
Browser โ Dispatcher Cache โ Response (Very Fast!)
In this case, AEM Publish is never contacted. The response is significantly faster.
Understanding this concept is critical for every AEM developer.
When a request reaches Dispatcher, one of two things happens:

The requested page already exists in cache. This is the ideal scenario.
The response is extremely fast because:
The requested page is not available in cache. Now AEM Publish must generate the page.
Process:
Cache miss requests take significantly longer because rendering must occur.
A common question from new developers is:
If Dispatcher is caching pages, how do users see updated content after a publish?
Enter cache invalidation.
Say an author updates the homepage and publishes the changes.
If the old cached version remains in Dispatcher, users will continue seeing outdated content.
To prevent this, AEM triggers a cache flush process after publishing:

This is one of the most important concepts to understand when troubleshooting content update issues.
Many production issues that appear to be rendering problems are actually caching problems.
One of the most common tickets in AEM projects looks like this:
"I published the page, but I still see the old content."
Many developers immediately start checking:
However, the issue is often unrelated to rendering.
A better troubleshooting approach is to verify each layer involved in content delivery rather than immediately investigating rendering code:
Start with the publish action, then validate cache invalidation, content delivery, and cache refresh mechanisms.
When content is not visible after publishing:

In many cases, the root cause is a cache invalidation issue rather than a component issue.
This is why understanding request flow is more important than immediately looking at code.
Author says:
"I updated the homepage 10 minutes ago but visitors still see old content."
Possible causes (none involve Sling Models):
Notice that none of these involve Sling Models. This is why architects always start from the request path before looking at component code.
In real production environments there is often another layer in front of Dispatcher.
A CDN such as CloudFront, Akamai, or Fastly may serve cached responses before requests even reach Dispatcher:

This means that troubleshooting content visibility issues may involve:
In large enterprise implementations, CDN cache hit rates are often significantly higher than Dispatcher cache hit rates, meaning many requests never reach AEM infrastructure at all.
This also means invalidating CDN cache is critical after content updates.
When a production issue occurs, experienced AEM engineers rarely start by opening component code.
Instead, they follow the request path:
Browser
โ
CDN
โ
Dispatcher
โ
Publish
โ
Rendering
The goal is to identify where the request is failing before investigating implementation details.
This approach often saves hours of debugging because many production issues are caused by:
rather than component code.
Not true.
Dispatcher also provides:
Caching is only one responsibility.
Not necessarily.
The request may still be served from:
Content must be published, cache invalidated, and client caches refreshed before updates are visible.
Many AEM developers have heard "Try Ctrl + F5."
Sometimes the problem exists on:
and not in the browser. Browser cache refresh won't help in these cases.
Actually, a healthy production environment tries to avoid that.
Ideal scenario:
Browser
โ
Dispatcher Cache
โ
Response (AEM Publish not contacted)
AEM Publish should render pages only when necessary (cache misses).
If Dispatcher cache hit rate is low, investigate why:
Use this order when content is stale or behavior differs between environments:
At this point, the request has successfully reached AEM Publish.
Sling takes over from here.
The request enters the Sling Request Processing Engine, which is responsible for:
This is where the real AEM rendering journey begins.
Once the request reaches Sling, a fundamental question must be answered:

How does AEM know which content to load?
To answer that, we need to understand the most important abstraction in Sling: The Resource.
In the next chapter, we will explore Resources, ResourceResolver, and ValueMap, which form the foundation of almost every feature in AEM.
In the next chapter, we will move beyond the request itself and explore:
These concepts form the foundation of Sling and AEM rendering, and understanding them is essential for every AEM developer.
Get an email when I publish the next chapter. No spam โ just new technical deep-dives.
Comments
Share feedback or questions about this blog post.
No comments yet. Be the first to share your thoughts.