MaxServ / t3ext-fal_s3

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

[BUGFIX] Improve caching of files and folders #17

Closed helhum closed 7 years ago

helhum commented 7 years ago

When iterating over files in S3 storage most time is spent for I/O wait (the web requests to Amazon).

To improve performance reading the content of a directory should only happen once and then be cached.

Instead of building multiple cache entries for one directory (one with files, one with folders and one with both), we fetch store only one entry with files and folders, and filter the result requested from TYPO3 API.

By doing so, searching from root, will warmup the complete cache, so that other storage listings will already be cached.

Now the caching logic is moved to a new CachedDirectoryIterator, so we can remove the cache handling from the driver.

arnoschoon commented 7 years ago

Thanks @helhum, sorry for the late review but with a tiny modification to maintain support for earlier releases I just integrated the patch.

The backwards compatibility is to ensure CMS7 can still be fully supported even on old versions of PHP (https://typo3.org/download says it does anyway).