To ensure that the expected cache file name (root.model.india.100.json) is generated in your AEM Dispatcher, you need to adjust the Dispatcher configuration to handle the cache file naming properly. The key issue here is that the dispatcher is not using the full path of the URL to generate the cache filename.
Steps to modify Dispatcher configuration:
Check rewrite rules in Dispatcher configuration: Ensure that the dispatcher is properly rewriting the request URL to include all necessary parameters and path elements when generating the cache file.
Modify Cache URL Configuration (/etc/dispatcher/cache): In your dispatcher.any configuration file, look for the cache section where cache file names are defined. You may need to modify the cache URL to handle the full path properly.
Use a cache rule with full path handling: You may need to adjust the cache file generation rules to reflect the full URL path. For example:
/cache
{
/rules
{
/0001
{
/glob "*/jcr:content/*.json"
/url "/content/experience-fragments/xf/sample/global/cnt/india/jcr:content/*.json"
/cache "/content/experience-fragments/xf/sample/global/cnt/india/jcr:content/*.json"
}
}
}
Ensure URL Params Are Included in Cache Key: If your cache rule depends on URL parameters (e.g., root.model.india.100), make sure the URL parameters are included in the cache key. Use wildcard or regular expressions to match dynamic parts of the URL for cache file generation.Flush the Cache After Changes: Once you update the dispatcher configuration, flush the dispatcher cache to ensure the new rules take effect.