MaxServ / t3ext-fal_s3

S3 driver for FAL
GNU General Public License v2.0
13 stars 10 forks source link

[FEATURE] Use caches for file and folder count methods in driver #68

Closed djcprinse closed 2 years ago

djcprinse commented 2 years ago

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.