You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/hosting/infrastructure/filesystem.md
+108Lines changed: 108 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -221,6 +221,114 @@ shopware:
221
221
222
222
If your S3 provider does not use buckets as subdomain like Minio in default configuration, you need to set `use_path_style_endpoint` to `true` inside `config`.
223
223
224
+
#### Custom HTTP client for S3
225
+
226
+
By default, the underlying AsyncAws S3 client creates its own HTTP client internally, which includes a `RetryableHttpClient` with an AWS-specific retry strategy. This handles transient errors like throttling (HTTP 429), server errors (HTTP 5xx), and other AWS-specific error codes automatically.
227
+
228
+
If you need to customize the HTTP behavior for S3 operations (e.g., timeouts, HTTP protocol version, or proxy settings), you can register a service with the ID `shopware.filesystem.s3.client`. When this service exists, Shopware injects it into both the filesystem adapter and pre-signed URL generation.
229
+
230
+
::: info
231
+
When you provide a custom HTTP client, AsyncAws will **not** wrap it in its own `RetryableHttpClient`. If you need retry behavior, you must configure it yourself as shown below.
232
+
:::
233
+
234
+
**Simple configuration** (custom timeouts, no retry handling):
235
+
236
+
```yaml
237
+
# config/packages/framework.yaml
238
+
framework:
239
+
http_client:
240
+
scoped_clients:
241
+
s3.http_client:
242
+
base_uri: '{your-s3-endpoint}'
243
+
timeout: 30.0
244
+
http_version: '1.1'
245
+
```
246
+
247
+
```php
248
+
// config/services.php
249
+
<?php declare(strict_types=1);
250
+
251
+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
252
+
253
+
return static function (ContainerConfigurator $configurator): void {
This wraps your scoped client in a `RetryableHttpClient` with the same `AwsRetryStrategy` that AsyncAws uses by default, preserving retry behavior for AWS-specific transient errors while allowing you to control timeouts, HTTP version, and other transport-level settings.
298
+
299
+
**Without scoped clients** (standalone service definition with retry support):
300
+
301
+
```php
302
+
// config/services.php
303
+
<?php declare(strict_types=1);
304
+
305
+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
306
+
use Symfony\Component\HttpClient\HttpClient;
307
+
use Symfony\Component\HttpClient\RetryableHttpClient;
308
+
use Symfony\Contracts\HttpClient\HttpClientInterface;
309
+
310
+
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
311
+
312
+
return static function (ContainerConfigurator $configurator): void {
This creates a plain HTTP client via `HttpClient::create()` with custom options and wraps it in a `RetryableHttpClient` with the default retry strategy.
331
+
224
332
### Google Cloud Platform
225
333
226
334
In order to use the Google Cloud Platform adapter you need to install the `league/flysystem-google-cloud-storage` package.
0 commit comments