Images account for the bulk of most websites’ load times. With a few clicks, Image Optimization can improve load times and make you and your visitors happier. Image Optimization is only available when Kinsta’s CDN is enabled.

Image optimization does not alter the images stored in your site files; it creates new images. The new images don’t require additional storage, and they will not count toward the disk space use of your Kinsta plan.

When Lossless or Lossy is enabled, the CDN automatically creates WebP versions of the images on the fly using Cloudflare’s Polish service. The WebP versions are cached in Cloudflare’s CDN and are delivered if:

  1. the Accept header in the visitor’s browser includes WebP, and
  2. the WebP version is significantly smaller.

The CDN will deliver the original image if it is smaller than the WebP version.

Enabling Image Optimization

To enable Image Optimization on your site, log in to MyKinsta, go to WordPress Sites > sitename > CDN, and click on Settings under Image Optimization.

Image optimization settings in MyKinsta.
Image optimization settings in MyKinsta.

That will bring you to a new window where you choose between Lossless or Lossy image optimization:

Image optimization options in MyKinsta.
Image optimization settings in MyKinsta.

Lossless Image Optimization

Lossless Image Optimization is done with lossless compression and has no impact on the quality of your images. Only GIF and PNG images are compressed, and WebP versions of those images are created. Metadata is removed from all images.

Selecting the Lossless image optimization option in MyKinsta.
Selecting the Lossless image optimization option in MyKinsta.

Select this option if retaining your image quality is essential. If you want to compress and make WebP versions of JPEG images, you’ll need to select the Lossy option.

After you click the Save Settings button, the CDN page should look like this:

Lossless image optimization enabled in MyKinsta.
Lossless image optimization enabled in MyKinsta.

Lossy Image Optimization

Lossy Image Optimization may reduce the quality of your JPEG images because it uses lossy compression to make those images as small as possible. This option will compress GIF and PNG files the same as the lossless option and remove metadata from all images. It will also create Webp versions of all images, but the Webp version is only used if it is significantly smaller than the lossy or lossless compressed image.

Selecting the Lossy image optimization option in MyKinsta.
Selecting the Lossy image optimization option in MyKinsta.

Select this option to maximize image optimization, understanding that it may impact image quality.

After you click the Save Settings button, the CDN page should look like this:

Lossy image optimization enabled in MyKinsta.
Lossy image optimization enabled in MyKinsta.

Test Image Optimization

Image Optimization doesn’t change the URL or file extension of the image, and it will not alter the HTML of your website’s pages. To confirm Image Optimization is working, you can inspect the HTTP headers of an image on your site with your browser’s built-in developer tools.

  1. Visit your site and open developer tools in your browser (right-click on the page or an image and click Inspect).
  2. On the Network tab, reload the page if needed and select an image.
  3. In the Headers tab for the selected image, scroll down until you see the Response Headers and look for these headers and values:
    1. cf-polished: This shows you the original format and file size of the image. If the generated WebP version of the image is a larger file size than the original image, the original image is still used.
    2. content-type: This shows you what file format is being served, regardless of the URL or file extension.
    3. ki-cache-type: This should have a value of CDN.
    4. ki-cf-cache-status: This should have a value of HIT. This, in combination with a ki-cache-type header value of CDN shows that the image is being served by Kinsta’s CDN.

Disabling Image Optimization

To disable Image Optimization on your website, log in to MyKinsta, go to WordPress Sites > sitename > CDN and click on Settings for Image Optimization. From the new window, select None and click on Save Settings.

The CDN page will now reflect no Image Optimization settings are applied and will look like this:

Image optimization disabled in MyKinsta.
Image optimization disabled in MyKinsta.