Skip to content

Commit 2454092

Browse files
committed
docs: add section for rate limiting
1 parent a828e84 commit 2454092

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ php artisan vendor:publish --tag="image-transform-url-config"
4040

4141
## Usage
4242

43-
1. Configure the package via `config/image-transform-url.php` to set your [`public_path`](https://laravel.com/docs/12.x/helpers#method-public-path) directory, from where you want to transform the images.
43+
1. Configure the package via `image-transform-url.php` to set your [`public_path`](https://laravel.com/docs/12.x/helpers#method-public-path) directory, from where you want to transform the images.
4444
It is recommended to use a dedicated directory for your images in order to have a separation of concerns.
4545

4646
2. Test your first image transformation:
@@ -98,9 +98,17 @@ To force a revalidation, you can either:
9898
3. change the version number (integer) in the options (e.g. `version=2`)
9999
4. or flush the entire cache of your application using the `php artisan cache:clear` command.
100100

101+
## Rate Limiting
102+
103+
Another feature of this package is the ability to limit the number of transformations that the image transformation route should process per path and IP address within a given time frame.
104+
105+
The rate limit will come into effect for new transformation requests only, and will not affect previously cached images. It is also only applied in the `production` environment.
106+
107+
You can configure the rate limit settings in the `image-transform-url.php` configuration file.
108+
101109
## Usage with CDNs
102110

103-
This package is designed to work seamlessly with CDNs like Cloudflare, BunnyCDN, and others.
111+
The package is designed to work seamlessly with CDNs like Cloudflare, BunnyCDN, and others.
104112

105113
The most important configuration is the [`Cache-Control`](https://developer.mozilla.org/de/docs/Web/HTTP/Reference/Headers/Cache-Control) header, which you can customize to your liking in the `image-transform-url.php` configuration file.
106114

0 commit comments

Comments
 (0)