Cloudinary Blog

How to get media to load faster on your website

By Kasia Kramnik
Tips and tricks to help your website's media load faster

This is a guest post by Kasia Kramnik, Content Marketing Manager at Netguru, a full stack development house and one of Cloudinary's Consulting partners.

Take a look at your website. Are you happy with the way it looks? I bet you are, and that’s really awesome. Keep in mind though, there is one thing you can’t actually see, but you need to experience: the load speed. Sometimes the most important element is invisible to the eye. In this article you’ll find tips on perfecting the invisible as well: loading your site and media with visibly better results.

Why is fast loading important anyway?

The reason is simple and it should be crucial to you: your users. They get impatient, they have a low attention span, and they won’t hesitate to leave your website if they have to wait. You may grumble about how hasty your potential customers are, but that’s exactly the challenge: dealing with their tendency to abandon anything that requires patience. One of the online surveys conducted on 2,500 online consumers in the US and UK found that 67% of UK shoppers and 51% in the US admit that a site's slowness is the top reason they’d abandon a cart in an online store.

It’s also worth noting that Google has incorporated site load speed into a list of factors influencing the search ranking position. It seems like there are enough reasons to take a closer look at loading times, but what if the results are far from excellent? How can you speed your page up? Here are a few tips regarding media upload, management, and storage.

page load speed

Save images for the web

The process of load speed optimization starts before the images actually land on your page. When you’re working on your images in any sort of graphics tool, make sure you save them in a format that’s compatible with web publication. This limits the amount of metadata carried on an image and makes it easier to edit the image quality.

What formats are applicable for the web? There’s a variety of options:

  • Scaleable Vector Graphics (.SVG) - preserves its quality no matter the size on screen, best for logos; lossless.
  • Portable Network Graphics (.PNG) - best for high-resolution, detailed graphic images you want to present in full quality; lossless.
  • Graphic Interchange Format (.GIF) - for simple animations; lossy.
  • WebP - an image format supported by Chrome browsers; either lossy or lossless.
  • Joint Photographic Experts Group (.JPEG or .JPG) - best for scalable images; lossy.
  • JPEG-XR - an improved variation of JPEG format supported by IE browsers, suitable for scalable images; lossy.
  • JPEG2000 - a higher-quality JPEG format supported by IE browsers; lossy.

Format comparison example:

196 KB in PNG format:

 PNG format

https://res.cloudinary.com/demo/image/upload/w_400/turtles.png


25.2 KB in JPEG format with 80% quality:
 

JPEG format

https://res.cloudinary.com/demo/image/upload/w_400,q_80/turtles.jpg


20.1 KB in WebP format with 80% quality: 
 

WebP format

https://res.cloudinary.com/demo/image/upload/w_400,q_80/turtles.webp

 ‘Lossy’ vs ‘lossless’ file formats

While some file formats are very prone to lossy formatting, i.e. altering or losing any original information from the source file, media files are perfect material for lossy formatting. Our eyes are not able to receive all the information coded in every pixel, which means you can easily cut down on redundant data and decrease the file size.
 
For ‘lossy’ formats, the formatting eliminates some pixel data completely. For ‘lossless’ formats, the pixel information is compressed, but still maintained. Typically, ‘lossy’ formatting enables more options for file quality and size.

Work on image size and quality

Image and video file formats have various properties, including their sizes. Some of them might be suitable for all devices, others will only load well on desktop screens, and not all of them are suitable if you want to reduce your page load speed. Also, the image quality required for different screens will vary.
 
What can you do to make sure you use the best file format and quality for optimal load speed? Of course, there are a variety of tactics to use, but these will enable you to start in the right place:
  • Scale or crop images to match the display size. These are typical elements of responsive design, but since it’s not just about being responsive, you’ll find more about it in the next section.
  • Adjust image quality to match the screen resolution. The lower the quality, the smaller the file size. Remember to use lossy formats!
  • Convert lossless formats into lossy, e.g. replacing a PNG (lossless) file with a lower-quality (let’s say 70%) JPG image. Another example: you can decrease the size of animated GIFs when converting them to WebM or MP4 formats.

Think mobile-first 

Picking the right approach to design will definitely help you change the way you perceive the role of images on your website. But what’s the practical difference between desktop-first and mobile-first? Let’s explain with a comparison.
 
In a desktop-first approach to front-end development and web design, you start from the version of your website that uses heavy components by default. You get used to the thought that putting them there is kind of natural and obvious. Then, when designing the same website for tablets and smartphones, you wonder what elements you need to reduce to make things still work. This approach is also called graceful degradation.
 
On the other hand, the idea behind mobile-first front-end development and web design works on a precaution that the website should give you maximum necessary content with minimum space and weight. You obtain this effect, for example, by using responsive, scalable images and quality adaptable for particular devices. By starting from mobile and progressively enhancing for tablets and desktops, you reduce redundant elements.

Wrapping up

Load speed is crucial for your website conversion and search rank. To optimize it, you may experiment with file formats, scaling, adjustable quality, and other factors. Remember the difference between lossy and lossless formats, and make sure you use each format according to the file’s purpose. Also, pay attention to mobile-first design, as it will help you create more efficient, faster-loading sites.
If you’re using Cloudinary, your worries will be limited to uploading the best-looking picture - all image cropping, conversion and optimization is accomplished with dynamic delivery URLs. You’ll find more info on Cloudinary's Solutions page.
 
P.S. If you would like to test your page load speed, this list of testing tools will definitely help!
 

Recent Blog Posts

Our $2B Valuation

By
Blackstone Growth Invests in Cloudinary

When we started our journey in 2012, we were looking to improve our lives as developers by making it easier for us to handle the arduous tasks of handling images and videos in our code. That initial line of developer code has evolved into a full suite of media experience solutions driven by a mission that gradually revealed itself over the course of the past 10 years: help companies unleash the full potential of their media to create the most engaging visual experiences.

Read more
Direct-to-Consumer E-Commerce Requires Compelling Visual Experiences

When brands like you adopt a direct–to-consumer (DTC) e-commerce approach with no involvement of retailers or marketplaces, you gain direct and timely insight into evolving shopping behaviors. Accordingly, you can accommodate shoppers’ preferences by continually adjusting your product offering and interspersing the shopping journey with moments of excitement and intrigue. Opportunities abound for you to cultivate engaging customer relationships.

Read more
Automatically Translating Videos for an International Audience

No matter your business focus—public service, B2B integration, recruitment—multimedia, in particular video, is remarkably effective in communicating with the audience. Before, making video accessible to diverse viewers involved tasks galore, such as eliciting the service of production studios to manually dub, transcribe, and add subtitles. Those operations were costly and slow, especially for globally destined content.

Read more
Cloudinary Helps Minted Manage Its Image-Generation Pipeline at Scale

Shoppers return time and again to Minted’s global online community of independent artists and designers because they know they can count on unique, statement-making products of the highest quality there. Concurrently, the visual imagery on Minted.com must do justice to the designs into which the creators have poured their hearts and souls. For Minted’s VP of Engineering David Lien, “Because we are a premium brand, we need to ensure that every single one of our product images matches the selected configuration exactly. For example, if you pick an 18x24 art print on blue canvas, we will show that exact combination on the hero images in the PDF.”

Read more
Highlights on ImageCon 2021 and a Preview of ImageCon 2022

New year, same trend! Visual media will continue to play a monumental role in driving online conversions. To keep up with visual-experience trends and best practices, Cloudinary holds an annual conference called ImageCon, a one-of-a-kind event that helps attendees create the most engaging visual experiences possible.

Read more