The AEM Dispatcher plays a crucial role in caching to optimize the performance and delivery of content in Adobe Experience Manager (AEM). However, not all requests can be cached. This blog post will outline the criteria for cacheable requests and highlight scenarios that make requests uncacheable by the Dispatcher.
1. Cacheable Requests
The Dispatcher can cache a URL if it meets the following criteria:
- Configured to be Cacheable: The request is explicitly configured as cacheable in the Dispatcher configuration.
- Plain GET Request: The request is a simple HTTP GET request.
- URL with Extension: The request URL must include an extension, such as .html.
2. Non-Cacheable Requests or Responses
There are several scenarios where requests or responses cannot be cached by the Dispatcher:
- Denied by Configuration: Requests that are denied caching by specific configuration settings, such as paths, patterns, or MIME types.
- Special Headers:
- Responses that include a “Dispatcher: no-cache” header.
- Responses that include a “Cache-Control: no-cache” or “Cache-Control: private” header.
- Responses that include a “Pragma: no-cache” header.
- Request with Query Parameters: Any request that contains query parameters.
- URL Without Extension: URLs that do not have an extension cannot be cached.
- URL with Suffix Without Extension: URLs that have a suffix lacking an extension.
- Non-200 Status Code: Responses that return a status code other than 200.
- POST Requests: HTTP POST requests cannot be cached as they typically involve changes to the server state.
3. Conclusion
Understanding which requests and responses are cacheable is crucial for optimizing the performance of your AEM instance. By ensuring that only appropriate content is cached and by configuring your Dispatcher settings correctly, you can improve both the speed and reliability of your website. Keep these rules in mind to ensure effective caching with AEM Dispatcher.