Named Transforms
Last updated
Last updated
Named transforms are custom shortcut strings for image transformations.
For example;
You are using w_150,h_150,g_face,c_thumb,r_100,bo_5_skyblue
transform string for small thumbnails for your images. You can assign this long transform string to a smaller string like thumbnail
and call it from your transform string as n_thumbnail
Go to your Dashboard and try out Named Transforms.
When putting a named transform in your transform string, you should write n_ before your named transform. Eg. thumbnail -> n_thumbnail
https://demo.imagemash.io/w_150,h_150,g_face,c_thumb,r_100,bo_5_skyblue/woman2.jpg
You can also send additional parameters while using named transforms. You can even override the named transform parameter by writing a new parameter after your transform string.
It helps you to create understandable parameters and boosts your speed.
You can edit your named transforms in your dashboard.
For example:
You have a named transform called thumbnail
You used this named transform to serve images. Now you decided to add some parameters or change the parameters of it. Let's say you changed w_100
to w_150
. Previous images that have n_thumbnail
will still be w_100
. Change will affect only new transforms.
Possible solution other than purging:
Add parameter after your n_thumbnail
. It will override the previous w_100
in your n_thumnail
. So you don't need to change your thumbnail at all.
Eg. demo.imagemash.io/n_thumbnail,w_150/woman2.jpg
Depending on the selected behavior, it adds security layers to your CDN Link.
No Behaviour All transform requests are allowed.
Transform string must contain at least 1 named transform If no named transform in the transform string, the server will ignore the request.
Ignore all transforms except named transforms Only named transforms are allowed in the transform string
Be careful about caching. If you change the parameters of your named transform, previous images containing this named transform will serve the previous versions, because they are cached. You may need to your images.