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 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 compressed image is significantly smaller than the original image.

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 Image Optimization, Settings.enable image optimization in MyKinsta

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

image optimization options in MyKinsta

Lossless Image Optimization

Lossless optimization has no impact on the quality of your images. GIF and PNG images are compressed, and metadata is removed from all images.

Select this option if retaining your image quality is essential.lossless image optimization option in MyKinsta

After you click the Save Settings button, the CDN page should look like this:lossless image optimization option enabled in MyKinsta

Lossy Image Optimization

Lossy Image Optimization may reduce the quality of your images because it uses JPEG compression to make images as small as possible. Like Lossless optimization, this will also compress GIF and PNG images and remove metadata from all images.

Select this option to maximize image optimization, even if it may impact the image quality.lossy image optimization option in MyKinsta

After you click the Save Settings button, the CDN page should look like this:lossy image optimization option 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:no image optimization options enabled in MyKinsta