Expand my Community achievements bar.

SOLVED

Dispatcher does not cache PDF under /formsanddocuments

Avatar

Level 2

Hi Team - I am trying to understand why a dispatcher cannot cache the PDF documents uploaded into Forms and Documents section, /content/dam/formsanddocuments .

 

I uploaded a PDF documents into forms and documents and tried accessing it with Publisher by appending the content dam path of the PDF and made sure it opened the PDF with extension (as this a requirement for dispatcher to cache). However i do not see it being cached. But it caches the same PDF uploaded under /content/dam. What is controlling this, my cache.any file has "allow" to glob "*".

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Employee

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





 

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

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