Url is content/experience-fragments/xf/sample/global/cnt/india/jcr:content/root.model.india.100.json .
cache file generated is root.model.json but expected is root.model.india.100.json. what changes required in dispatcher configs to get the expecteed cache file name?
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
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.
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.
Update your dispatcher configuration to handle full URL paths and dynamic query parameters for cache naming. Specifically, make sure the cache rule for JSON files (*.json) reflects the full URL structure so that the correct cache file name (root.model.india.100.json) is generated.
If root.model.json is not expected, either deny this request using /filters or deny them using the /cache.
However I have a question. How are you going to allow the selectors like 100 or india? It looks like a dynamic selector.
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.
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.
Update your dispatcher configuration to handle full URL paths and dynamic query parameters for cache naming. Specifically, make sure the cache rule for JSON files (*.json) reflects the full URL structure so that the correct cache file name (root.model.india.100.json) is generated.
@AnanA1 Did you find the suggestions helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies