MaxServ / t3ext-fal_s3

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

Improve speed of browsing in filelist #8

Closed arnoschoon closed 7 years ago

arnoschoon commented 7 years ago

This patch implements a full result cache on the resolveFolderEntries action. The result of this action is used to get a count of items and check if a folder contains subfolders (access to it is frequent).

Compared to uploading actual new files or creating the folders users like to read fast. This is what this patch aims to do. Directory listings are pretty static, and as soon a file is added the cache for that particular folder is flushed.

Targeted flushing is implemented in an attempt to prevent constant flushing and rebuilding of the whole file set if different users choose to update all their folders. By default the File backend is used since it supports TTL and tagging, but when used in a production setup you should consider Redis or some other alternative that doesn't hurt the file system.

arnoschoon commented 7 years ago

Fixed recursive deletion of directories together with the correct flushing of the ls-cache as mentioned by @Tuurlijk.

Also the possibility to create a folder directly after deleting it is fixed since I came across that issue while testing. If you wanted to re-create a folder directly after deleting it the is_dir check still returned true even though the folder was removed, this was caused by a key mismatch in the stat cache. A folder was added using maxserv.fals3.contentstorage://foldername but removed using maxserv.fals3.contentstorage://foldername/.