How to Optimize Content with Kentico

Ken Jones
November 19th, 2019
How to Optimize Content with Kentico


By Joseph LoPresti, Solutions Engineer

Here at ScientiaMobile, we’ve had a couple of ImageEngine clients ask us how to enable ImageEngine for Kentico. So I’m going to walk you through what I’ve helped them with.

If you’re not familiar with Kentico, it’s a .Net-based all-in-one CMS, eCommerce, and online marketing platform. With a rich customizable feature set, companies of all sizes can take advantage of this platform. Kentico includes an open API, enabling integration into almost anything as well as an intuitive UI so users without development experience can work with the platform.

By enabling ImageEngine on Kentico, (request a trial token or signup for ImageEngine here) you can ensure that your images are properly scaled and optimized across all devices and delivered through a global content delivery network. Also, if you take advantage of the IIS rewrite module, you can easily update the image URL with your ImageEngine CNAME. Here is an example using the standard media path settings in Kentico. You can easily customize this if you have a custom path.

Standard Media Path Setup in Kentico

In your web.config file within <system.webServer> add the following:



        <rule name="Rewrite Media to CDN" preCondition="IsHTML">

            <match filterByTags="Img" pattern="/getmedia/(.*)" />

            <action type="Rewrite" value="{R:1}" />


        <rule name="Rewrite Media Files to CDN by path" preCondition="IsHTML">

            <match filterByTags="Img" pattern="/media/(.*)" />

            <action type="Rewrite" value="{R:1}"/>




Here is a link to the IIS Rewrite module documentation for more information on configuration:

Images as Background

If you are using images as a background in your CSS, you will need to use the absolute path with the CNAME domain in order for it to properly optimize.

There are also plugins in the marketplace that enable this functionality as well, but they do not always support the latest version of Kentico:

  • Laughlin Kentico CDN Rewrite 1.0, which works up to Kentico version 8.2

  • Kentico CDN Injector module, which works up to Kentico 6.0

With these steps, you should be all set and ready to improve your website for the better. If you have any questions or concerns about getting started, you can always contact me at and use our free resources such as our ImageEngine Getting Started Guide.