googleapis / googleapis/google-cloud-php
Cloud Storage - Implement method to check existence of multiple objects in a single operation
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 463
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 145
Description
Hello
We are using the PHP cloud storage library, and we are facing a performance issue to check existence of multiple objects in a storage bucket.
Currently, the only way to implement such check is by using a loop such as:
```
$names=["file1","file2",...,"fileN"];
foreach ($names as $name)
{
$object=$bucket->object($name);
if (!$object->exists()) {...};
}
```
This triggers a REST api call for each of the objects, which is slow. We usually have around 10 object names per loop, so this takes around 0.4s.
As we do this a lot of times, we have a performance issue.
It would be great to have a method in the Bucket class to check multiple object names at once, with a single request to the cloud storage back-end APIs (not sure such method exists in the back-end API).
Thanks !
Contributor guide
Assessment
This issue has not been assessed yet.