Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Local dispatcher not caching pages

Avatar

Level 1

I've set up the Dispatcher Tools locally, but it appears that nothing is being cached by the local dispatcher.

 

I verified this by creating a simple AEM component to print out the current time, similar to what's used for testing in the sling dynamic include video tutorial. I also verified that the sitemap xmls are the only files inside /mnt/var/www/html in the docker container.

 

I verified that my project's dispatcher configs are loaded, and they are the same configs that are used in our cloud environments where cache does work.

 

Does anyone know what might be going on here or what the next step would be to debug?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Check cache rules and /ignoreUrlParams. For caching all use this rule

/0000 {
/glob "*"
/type "allow"
}

Make sure someone is not modifying the request. like cloudflare

View solution in original post

6 Replies

Avatar

Community Advisor

Hi @cecilyd 

 

All the calls made to the dispatcher are stored in its logs. Please use this link as a reference to start your debugging: https://blogs.perficient.com/2017/10/12/mastering-aem-dispatcher-part-1-debugging-the-dispatcher/

 


Hope this helps!


Thanks,
Kiran Vedantam.

Avatar

Correct answer by
Community Advisor

Check cache rules and /ignoreUrlParams. For caching all use this rule

/0000 {
/glob "*"
/type "allow"
}

Make sure someone is not modifying the request. like cloudflare

Avatar

Community Advisor

Hi @cecilyd ,

 

Check for /cache rules is allowed properly in Dispatcher configs and also ensure if no cache headers are not set. thanks.

Avatar

Community Advisor

there are many scenario, when dispatcher wont cache the page, like if you don't have any extension to your page, if you are using any queryparameter while accessing the page and those queryStrings are not ignored, if you are using url prefix without extension etc.

So I would say first verify if you are using anything like above. If you are not using any of the above stuff, see the dispatcher log because this is the only place, which will tell you why page is not being cached.

Sometime people forget to add Dockroot path properly in the configuration, which enable no page cache on dispatcher. As you are using docker for dispatcher instance so I suspect this might be the cause.

Hope this helps

Umesh Thakur

Avatar

Community Advisor

Hi @cecilyd 

 

You should first change log level of dispacher to Trace and start tailing logs for dispatcher.log file. Follow this blog to debug dispatcher https://blogs.perficient.com/2017/10/12/mastering-aem-dispatcher-part-1-debugging-the-dispatcher/.

 

One of the following could be reason for caching not working:

1. Check the Document Root on dispatcher, it should point to /mnt/var/www/html in dispatcher.any file in below conf:

/cache
  {
  /docroot "/opt/dispatcher/cache"

Also, check DocumentRoot on your site.conf file and it should also point to same path like
<VirtualHost *:80>
DocumentRoot "/mnt/var/www/html"
</VirtualHost>

2. You might have to provide proper permissions on this /mnt/var/www/html, Error regarding the permission will appear on dispatcher.any file if that is the issue. You can follow this article to resolve permission issue : https://stackoverflow.com/questions/50378664/permission-denied-inside-var-www-html-when-creating-a-w...

 

Hope it helps!

Thanks

Nupur