I have three AEM author instances in a cluster - Mongo 3 instances replica set.
If i make a change to a template in crxde in one of the instances, i can see the change getting reflected in all 3 AEM instances in crxde, but when I am hitting a page of that template changes are not reflecting in the other two instances. Is there a cache configuration I am missing?
Have tried this on AEM 6.3.2 and 6.3.3
Restarting Apache Sling Resource Resolver on the other instance resolves the issue and I can see the new changes on the page.
So I found the HTMLs to be cached at /system/console/scriptcache . Once I cleared this cache it worked fine. I then changed the config at Apache Sling Script Cache to set the cache size to 0 so that nothing is cached. However i think this is an odd behavior of AEM in a mongo cluster where the cache is not invalidated automatically from the other AEM servers.
Any pointers on this ?
It is not an editable template but a static template and if i make a change on one server, the HTML of that component is invalidated on only that server and not the others. I believe since the change is reflected in all servers of the cluster the cache should also get invalidated in all, else there would always be an issue of some servers showing different content.
what do you mean with "the html of that component is invalidated ..."? Do you modify a template T (more specifically a page component T) and then you open a page based on this template/page component T ? And only on the server on which you perform the change the page display is changed, but not on the 2 others?
indeed, that's strange. Changes to components should be picked up by observation and then the script cache should get invalidated, there shouldn't be any explicit invalidation. Can you set the loglevel for the class "org.apache.sling.scripting.core.impl.ScriptCacheImpl" to DEBUG and re-do your tests again? Make sure that this logging is set on all cluster instances.
This is what i found in the debug log and this was observed on the server where the change was done and not seen in other servers.
23.10.2018 17:10:50.296 *DEBUG* [sling-script-cache-thread-pool-1] org.apache.sling.scripting.core.impl.ScriptCacheImpl Detected script change for /apps/sample/components/templates/cnt-errorpage/footer.html - removed entry from the cache.
23.10.2018 17:11:00.368 *DEBUG* [sling-script-cache-thread-pool-2] org.apache.sling.scripting.core.impl.ScriptCacheImpl Detected script change for /apps/sample/components/templates/cnt-errorpage/footer.html - removed entry from the cache.