The countFilesInFolder and countFoldersInFolder methods in the driver class were heavy and had to be executed everytime someone opened a folder.
The file and folder counts are being used in the filelist module to show the number of subfiles and -folders.
Without using the caching mechanism in the count methods, the driver had to fetch all files folders from S3 of the S3 caches, and count the result. When using the cache, the count will only be calculated once and fetched from cache.
By setting the cache tags equal to the cache tag set by the CachedDirectoryIterator for a directory, whe count caches will be cleared when a file or folder is being added, changed or removed from within the filelist.
An edge-case where incorrect counts are being saved, could occur if files or folders are being manipulated outside of TYPO3.
The
countFilesInFolder
andcountFoldersInFolder
methods in the driver class were heavy and had to be executed everytime someone opened a folder.The file and folder counts are being used in the filelist module to show the number of subfiles and -folders.
Without using the caching mechanism in the count methods, the driver had to fetch all files folders from S3 of the S3 caches, and count the result. When using the cache, the count will only be calculated once and fetched from cache.
By setting the cache tags equal to the cache tag set by the
CachedDirectoryIterator
for a directory, whe count caches will be cleared when a file or folder is being added, changed or removed from within the filelist.An edge-case where incorrect counts are being saved, could occur if files or folders are being manipulated outside of TYPO3.