Most leading blogs deliver their assets (images, JS, CSS, etc.) through state-of-the-art CDNs and utilize online resizing technologies. With faster, off-site access, they greatly improve their users’ browsing experience, while reducing load on their servers.
Using Cloudinary you can use these same technologies today, in your website or blog, without any hassle. Simply direct all your media assets to Cloudinary and they would be delivered to your visitors. You can even add alternative dimensions to your images’ URL and get your pictures in any desired size or perspective. All of this with minimum changes on your side.
UPDATE – March 2013: All Cloudinary media assets are delivered via the leading worldwide CDN of Akamai.
UPDATE – November 2016: Customers of the higher Cloudinary plans can choose between Akamai, CloudFront, or Fastly, or even take advantage of smart CDN selection or dynamic multi-CDN switching. For more details, see the multi-CDN blog post.
How it’s done? Simply prefix all your images with:
<em><strong>https://res.cloudinary.com/<your cloudinary cloud name>/image/fetch/</strong></em>
Code language: HTML, XML (xml)
Here’s a quick example:
Let’s assume that you’re hosting the following a photo of Jennifer Lawrence on your web server, and show it on your website:
<em><strong><a href="http://upload.wikimedia.org/wikipedia/commons/4/46/Jennifer_Lawrence_at_the_83rd_Academy_Awards.jpg" target="_blank" rel="noreferrer noopener">http://upload.wikimedia.org/wikipedia/
commons/4/46/Jennifer_Lawrence_at_the_83rd_Academy_Awards.jpg</a></strong></em>
Code language: HTML, XML (xml)
Now, simply replace this image’s URL with a URL with Cloudinary as a prefix:
<a href="https://res.cloudinary.com/demo/image/fetch/http://upload.wikimedia.org/wikipedia/commons/4/46/Jennifer_Lawrence_at_the_83rd_Academy_Awards.jpg" target="_blank" rel="noreferrer noopener"><em><strong>https://res.cloudinary.com/demo/image/fetch/http://upload.wikimedia.org/
wikipedia/commons/4/46/Jennifer_Lawrence_at_the_83rd_Academy_Awards.jpg</strong></em></a>
Code language: HTML, XML (xml)
Both URLs return the exact same image, only the second one is cached and delivered through fast, localized CDNs and not via your local web server. Better experience to your users. Lower load on your server. Lower hosting costs.
Note: that ‘demo’ in all the URLs should be replaced with your Cloudinary’s cloud name. Click here to set up one in seconds.
You can use this method to create different sized thumbnails for the same photo. For example, creating a 150×150 crop focused on Jennifer’s face (‘g_face’) and with rounded corners of 20 pixels (‘r_20’) generates the following beautiful image:
https://res.cloudinary.com/demo/image/fetch/w_150,h_150,r_20,c_thumb,g_face/
http://upload.wikimedia.org/wikipedia/commons/
4/46/Jennifer_Lawrence_at_the_83rd_Academy_Awards.jpg
Nice, isn’t it 🙂 see our docs of image transformations for plenty more options.
If you are a developer, you can do the same from code. For example, in Ruby on Rails:
cl_image_tag(“http://upload.wikimedia.org/wikipedia/commons/4/46/” +
“Jennifer_Lawrence_at_the_83rd_Academy_Awards.jpg”,
:type => :fetch, :width => 150, :height => 150,
:crop => :thumb, :gravity => :face, :radius => 20)
Note that if the image behind the original URL changes, Cloudinary will automatically update the images and videos embedded in your site and all its resized versions.
To summarize, any blogger and any website owner can now optimize and deliver images faster through a CDN for images and seamlessly create smartly resized and cropped images in any dimension. All that by just adding the Cloudinary resource URL as a prefix to all images and videos.
You can also refer to this Visual Web resource for Image Delivery and CDN.
- Image Optimization for Websites: Beautiful Pages That Load Quickly
- PHP Image Compression, Resize, and Optimization
- Python Image Optimization and Transformation
- Evolution of <img>: Gif without the GIF
- Top 10 Mistakes in Handling Website Images and How to Solve Them
- Three Popular and Efficient Ways for Loading Images
- Introducing Cloudinary’s WordPress Plugin for Dynamic Images and Video
- Compress an Image Automatically Without Losing Quality
- Automatically Reduce Image Size Without Losing Quality
- How to Automatically Adapt Website Images to Retina and HiDPI Devices