Expand my Community achievements bar.

Nomination window for the Adobe Community Advisor Program, Class of 2025, is now open!

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 roor.model.india.100.json. what changes required in dispatcher configs?

Avatar

Level 1

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?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies

Avatar

Level 4

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. 

Avatar

Level 6

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:

  1. 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.

  2. 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.

  3. 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.

 

  • Conclusion:

    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.