Usage with S3
This guide explains how to configure this package to work with S3-compatible storage services like AWS S3 or Cloudflare R2. This enables you to transform and serve images stored remotely without the need to store images on your local server.
Set up your S3 disk in your filesystems configuration, install the S3 package and ensure you have the necessary credentials and settings for your S3 bucket. Public bucket access is not required.
Configure the package via
image-transform-url.php
to include your S3 disk in thesource_directories
as described in the setup guide.If you are using the Image Caching feature and want to store transformed images back to your S3 bucket instead of your local filesystem, you may also set the
cache.disk
option in theimage-transform-url.php
configuration file to your S3 disk.
'cache' => [
//...
'disk' => env('IMAGE_TRANSFORM_CACHE_DISK', 's3'),
//...
],
WARNING
Having the cache.disk
set to your S3 disk may result in higher latency and costs due to the nature of remote storage. If you are concerned about performance, consider using a local disk for caching and only use S3 for the source directories.
- You can now use the image transformation URLs as usual, and the package will handle fetching images from your S3 bucket.