DIspatcher Flush Issue - Stat file creation
Hi,
I am seeing an odd behavior while flushing cache, I am using AEM 6.5.16 with the wknd site for testing, also I am using a dispatcher in a Centos machine and it was set using the default configs from the AEM Project archetype (v41).
So, the statfilelevel is set to 2 by default as shown below:
/cache {
# The cacheroot must be equal to the document root of the webserver
/docroot "${PUBLISH_DOCROOT}"
# sets the level upto which files named ".stat" will be created in the
# document root of the webserver. when an activation request for some
# handle is received, only files within the same subtree are affected
# by the invalidation.
/statfileslevel "2"According to this documentation https://experienceleague.adobe.com/docs/experience-manager-learn/ams/dispatcher/disp-flushing.html?lang=en#stat-files-level my expectation would be to have .stat 3 files when a flush event is triggered, like below:
- /var/www/html/.stat (statfilelevel 0)
- /var/www/html/content/.stat (statfilelevel 1)
- /var/www/html/content/wknd/.stat (statfilelevel 2)
But actually, I see in the logs there are only 2 .stat files being created. These files are being touched correctly, if i re-flush the cache, those are being updated correctly (timestamp), so the cache "should" invalidate.

The problem is when I request again a page such as: [/content/wknd/us/en.html], the dispatcher is looking for a .stat file at a deeper level
[/mnt/var/www/html/content/wknd/.stat], which does not exist as explained above, and thus the cache is not invalidated.

So here are my questions:
1) Is really expected that only 2 .stat files should be created when the statfilelevel is set to 2? If not, how can I troubleshoot further?
2) Even if the file .stat does not exist at the deeper level, was not supposed that the dispatcher should look up the nearest .stat file? Which I understand is the one located at [/content/.stat] level and thus invalidates the whole [/content/wkn] path.
Things that I've tried so far that gave the same result:
- I made sure the dispatcher config is correctly set and restarted the Apache server several times,
- I made sure the directories have the proper write access and I have disabled SELinux security just in case is messing with the folder.
- Flush via CURL command or via ACS Flush Feature, the same result, only 2 files are created
- Increased the statfilelevel to 3, the .stat files are still only 2, what changes is that the dispatcher will look for a .stat file in a deeper level to validate against the previous invalidation process e.g: [/mnt/var/www/html/content/wknd/us/.stat]

Hope someone can provide some hints to understand what's going on.
Thanks in advance