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
|`width`| Set the width of the image. | integer | Values greater than the original width will be ignored. |
67
+
|`height`| Set the height of the image. | integer | Values greater than the original height will be ignored. |
68
+
|`quality`| Set the quality of the image. | integer |`0` to `100`|
69
+
|`format`| Set the format of the image. | string | Supported formats: `jpg`, `jpeg`, `png`, `gif`, `webp`. |
70
+
|`blur`| Set the blur level of the image. | integer |`0` to `100`|
71
+
|`contrast`| Set the contrast level of the image. | integer |`-100` to `100`|
72
+
|`flip`| Flip the image. | string |`h`(horizontal), `v`(vertical), `hv`(horizontal and vertical) |
73
+
|`version`| Version number of the image. | integer | Any positive integer. More info in the [Image Caching](#image-caching) section. |
73
74
74
75
> [!CAUTION]
75
76
> The `blur` option is a resource-intensive operation and may cause memory issues if the image is too large. It is recommended to use this option with caution, or disable it in the config.
76
77
78
+
## Image Caching
79
+
80
+
This package comes with the default option to automatically store and serve images statically for the requested options within the caching lifetime.
81
+
82
+
> [!NOTE]
83
+
> Having this feature enabled (default behavior) will help to reduce the load on your server and speed up image delivery.
84
+
85
+
The processed images are stored in the `storage/app/private/_cache/image-transform-url` directory by default. You can change the disk configuration in the `image-transform-url.php` configuration file.
86
+
87
+
> [!CAUTION]
88
+
> When using this option, there is one caveat to be aware of:
89
+
90
+
Source images are considered to be stale content by their file name and path.
91
+
92
+
If the content of an original source image changes, but the file name stays the same, the cached images will not be updated automatically until the cache expires.
93
+
To force a revalidation, you can either:
94
+
95
+
1. change the image's file name
96
+
2. move it into another subdirectory, which will change its path
97
+
3. change the version number (integer) in the options (e.g. `version=2`)
98
+
4. or flush the entire cache of your application using the `php artisan cache:clear` command.
0 commit comments