Search code examples
cachingaem

AEM Dispatcher - cache rules


I am looking to get an understanding on a part of AEM dispatcher configuration. This will go under /cache /rules section

It looks like something below

/rules
        {
        # initial blanket deny
          /0000
          {
            /glob "*"
            /type "deny"
          }
          /0100
          {
           /glob "*.html"
           /type "deny"
          }
        }

Does rule 100 mean that the dispatcher is not caching any html pages?


Solution

  • Yes, the rule

    /0100
    {
      /glob "*.html"
      /type "deny"
    }
    

    means that no files with the .html extension will be cached. See the documenatation for more details.

    I'm not sure what that would accomplish on a Publish instance. The only situation where it would seem apt would be if all HTML pages were rendered with user-specific data inline with the static parts (as in, user data rendered in JSP/HTL scripts responsible for displaying whole pages). Not caching HTML pages puts a significant strain on your Publisher farm. If the avoidance of caching dynamic data is the reason for this config, there are better ways to deal with serving user-specific data from AEM, each of which requires a change in your application and deployment architecture (AJAX calls, Server Side Includes, Sling Dynamic Inlcudes, Edge Side Includes, Templating Engines, to name a few).

    As pointed out in the other answer, this can be a valid rule when the dispatcher is set up in front of an Author environment.