Hi @kolluax,
The issue you're encountering, where a PDF document uploaded to /content/dam/formsanddocuments is not being cached by the Dispatcher, while the same document uploaded under /content/dam is cached, is likely caused by specific configuration settings in your Dispatcher setup.
Dispatcher caching is controlled by the cache.any and filters.any configuration files. These files define the rules for what content can and cannot be cached. Even if your cache.any file has a "/glob \"*\" /type \"allow\"" rule, other configurations might be blocking caching for the /content/dam/formsanddocuments path.
There might be explicit rules in cache.any or filters.any that deny caching for /content/dam/formsanddocuments. For example:
/0002 { /glob "/content/dam/formsanddocuments/*" /type "deny" }Such rules are sometimes added for security or functional reasons, especially in environments where forms and documents might contain sensitive or dynamic content. Check your Dispatcher configuration files for any rules explicitly denying caching for /content/dam/formsanddocuments. If such rules exist and caching is required, you can modify them to allow caching for PDF files under this path.
The dispatcher also respects certain HTTP response headers sent by the AEM Publisher. If the response includes headers like:
- Cache-Control: no-cache or Cache-Control: private
- Pragma: no-cache
- Dispatcher: no-cache
The content will not be cached, even if the Dispatcher configuration allows it. Inspect the HTTP response headers for requests to /content/dam/formsanddocuments/<PDF-file>.pdf using a tool like curl or a browser's developer tools. If caching headers are preventing caching, you may need to adjust the AEM Publisher configuration to remove or update these headers.
If you're working with static PDF documents and not Adaptive Forms, ensure that your Dispatcher rules distinguish between these use cases. For example:
/0001 { /glob "/content/dam/formsanddocuments/**/*.pdf" /type "allow" }This rule explicitly allows caching for PDF files under /content/dam/formsanddocuments.
Thanks
Pranay