Gaufrette
Gaufrette copied to clipboard
feature request: command buffering
As Gaufrette does not buffer commands, executing multiple commands on a remote service can cause considerable delays.
E.g. User deletes an uploaded image. All related sizes must also be removed from the remote service (e.g. S3). This will take 2 HTTP calls for every file: one to ensure the bucket exists, and one to delete the file. In the very regular situation where you keep 4 versions of each image, this will take 8(!) HTTP calls, a massive bottleneck.
I'd propose buffering of commands (after which a flush command executes all of it at once), or the option to concatenate commands.
one to ensure the bucket exists, and one to delete the file. In the very regular situation where you keep 4 versions of each image, this will take 8(!) HTTP calls, a massive bottleneck.
Do you have any prove of that? The AwsS3::ensureBucketExists()
method checks if the bucket exists only once.
I'd propose buffering of commands (after which a flush command executes all of it at once), or the option to concatenate commands.
It's not possible to do so right now: it would require some async filesystem implementation. But that's something we might do in some months :)
@NiR- , you're right, I was looking at a deprecated version which has an ensureBucketExists() on every delete() call. However, S3 supports deleting multiple objects:
http://docs.aws.amazon.com/AmazonS3/latest/dev/DeletingMultipleObjectsUsingPHPSDK.html
Would it be possible to allow access to this?
Then what you're looking for is a batchDelete
method. We can add it through a new BatchAdapter interface, and mimic the behavior in the Filesystem if adapters don't implement it. So yeah, it's totally feasible ;)
Hi @akerouanton @bluppfisk Is this issue is still relevant or can i close it ?
Hi @akerouanton @bluppfisk Is this issue is still relevant or can i close it ?
Hi
I no longer use Gaufrette and I've written some custom code to achieve what I wanted, but I imagine it could still be a useful feature.