Part 1: Optimize images automatically
You should use a CDN (Content Delivery Network) to optimize your images. A CDN is a network of servers that distribute content (like websites and web apps, in this case) across the world. When you upload an image to a website, it’s distributed across many different CDNs, which means it loads quickly for people accessing your site from all over the world.
To use a CDN:
- Upload your original high-quality images your WordPress server
- Install a plug in that uses a CDN.
Minimize file size
There are a few ways you can minimize the file size of your images without sacrificing quality.
- Use the most modern file type supported. Right now WebP is the best choice out there. Avif is up and coming, but is not yet supported by all browsers..
- Pick the right compression level. WebP has a 0-100% compression setting, where 100% is the best quality, but also largest file size. The best way is just to try until you find an acceptable level.
Format conversion
You can convert images from one format to another automatically using the Webien Image Optizer.
Your JPEG, PNG and GIF images or WebP formats into any other format that you choose.
Part 2: Serve images with CDN
When you’re ready to put your image in front of a global audience, you can use a Content Delivery Network (CDN) to serve it from one or more servers distributed around the globe. This means that your images will be served faster and more efficiently than they would be if they were hosted on your server alone.
A CDN is a group of servers that are optimized to serve static content like website images. To understand how this works, let’s imagine two people—you and me—and we want to share some photos with each other over email. If I send them directly from my computer, they will take longer for you to receive because my computer has further away connections than yours does. But if we both connect through an intermediary server (the same way Gmail or Hotmail connects us), then there is no longer any distance between our computers so the files go much faster!
Caching via Amazon Cloudfront
Once you’ve implemented the caching system, it’s time to make sure that it’s working as intended. To do this, you’ll need a tool that allows you to view your site’s HTTP requests and responses in real-time.
Check out Amazon Cloudfront’s endpoints page for details on how to configure the service with your domain name and any other necessary settings. You should also consider configuring your CDN provider(s) so they respect the Cache-Control headers sent by your web application server when serving images from its origin via HTTPS (e.g., https://.com).
Part 3: Resize image size after visitor viewport
For the final part of this tutorial, we’ll make our customers’ browsing experience better by resizing images based on the size of their browser. We’ll use a popular plugin called ImageResizer for this task.
To get started, install ImageResizer and activate it in WordPress. You can find installation instructions here: imageresizertool.com. Open up your WordPress editor and navigate to \wp-content\plugins\imager\img_resize\js\. Copy jQuery 1–2–3–4-minmax.js into your project directory and then open up index.html again in your text editor of choice (see Part 1).
Images are the biggest performance killer. Automation, CDN and dynamic resizing can help.
Images are the main reason for slow page load, poor user experience and high bounce rate. They also have a negative impact on conversion rates because they add extra weight to your website’s load time and increase bandwidth consumption costs.
Conclusion
Images are the biggest performance killer. Automation, CDN and dynamic resizing can help. The real-time image processing by Cloudinary is a great tool, both for developers and designers. It allows you to automatically optimize images, serve them from a CDN, cache them via Amazon Cloudfront and resize image size after visitor viewport in order to improve user experience.