Media Optimization & Cloudimage

March 3, 2026

Jahia provides a complete solution for media optimization: dynamic image resizing, CDN delivery, and optimization using modern formats (e.g., WebP). Our solution is based on Cloudimage, a product created by Scaleflex. You do not need to create an account or purchase Scaleflex Cloudimage directly; it is managed by Jahia.

Jahia Image Optimization Capabilities

  • Images are automatically compressed and converted to modern formats (e.g., WebP) using best-in-class algorithms. Depending on your source assets, you can typically expect significant file size reductions (e.g., up to ~75% for non-optimized JPEG files).
  • Images are copied and served via a CDN to ensure fast load times worldwide.
  • Developers can easily implement image resizing in their views.
  • Developers can also leverage transformations by adding URL parameters to the image (filters, rotation, blur, watermarks, etc.).

How to Get Started?

This feature is optional and not enabled by default. To activate it, contact your Customer Success Manager (CSM) and share the domain of the website where you want it deployed. The Jahia Support/Cloud team will then set up the module in a non-production environment so you can see the results and go live when you’re ready.

Scope — Which Media Are Optimized?

Which File Types?

All image formats are optimized: JPEG, PNG, WebP, GIF, SVG, AVIF, BMP, TIFF, ICO, JPEG 2000, etc.

Out of scope/known limitation: videos and PDF files are not processed.

In Which Mode?

Images are only optimized in live mode. In the Jahia authoring UI (Page Composer/Page Builder) or in preview mode, image rendering doesn’t change.

Which Images?

All images added in the HTML of your pages, including:

  • Images added from weak references (standard Jahia image field)
  • Images added from rich text fields
  • Images added from Jahia Studio in your templates

Out of scope/known limitation:

  • Images that are directly protected by live roles (protected by login to provide authenticated experiences), or referenced inside pages that are protected by live roles won’t be optimized.
  • Images referenced from your CSS files won’t be optimized. This limitation may be overcome in the next releases.

Important to Know

This feature can be deployed for organizations running Jahia on Jahia Cloud, using Jahia 8.1.6+. Cloudimage integration is still in beta, meaning you should first request deployment in a non-production environment and verify that images render correctly. In the long run, we may provide a solution for organizations hosting Jahia in-house (on-premises).

How Are URLs Rewritten?

In live mode, image URLs are rewritten. The rewritten URL is based on the server name configured for your website. If no server name is set, it uses the base URL of the page being rendered.

For instance, the URL of the following image: /files/live/sites/luxe/files/site/destinations/destination-Geneva.jpeg

will be rewritten to:

https://someToken.cloudimg.io/https://example.com/files/live/sites/luxe/files/site/destinations/destination-Geneva.jpeg

The Cloudimage module is installed and managed by the Jahia Cloud team. It is not available through the Jahia Store. If you download the module, note that it won’t work in a local environment.

Optimizing Your Images

Step 1 - Ensure the module is running and active on your website

Once the Jahia Cloud team deploys the Cloudimage module on your environment, here are the steps you need to follow:

  • Activate the Cloudimage module on the website on which you want to use it.
  • Flush the site cache (from the administration panel).
  • Wait 10–15 minutes.

Once active, the URLs of all live (published) images will be rewritten to be served from the Cloudimage CDN.

Step 2 - Resizing

A good practice when rendering images is to ensure they’re rendered at the right size. You don’t want an image of 2000px × 3000px (even if it is optimized) to be rendered as 200px × 300px. You may also want your image to be responsive to the viewport.

To change the size of the image, add URL parameters to your JSP or JSX view (for example, w and/or h). For instance: photo.jpeg?h=200&w=300. More details are available in Cloudimage documentation.

Step 3 - (Optional) Available transformations

Scaleflex Cloudimage also provides many other transformations (fit/crop, background, prevent enlargement, keep proportions, flip, rotate, trim, rounded corners, background removal, etc.). Details can be found in the Cloudimage documentation on image operations.

Other advanced features are also available such as filters and watermarking.

How to Use This Feature as a Developer?

While the Cloudimage integration works right out of the box, you can build on top of Cloudimage’s features to further improve your website’s performance. For instance, here’s how to display a responsive image in your Jahia views so that no bandwidth goes to waste.

In JSX:

<picture>
  <source media="(min-width: 960px)" srcSet={`${buildNodeUrl(image)}?w=1920`} />
  <source media="(min-width: 480px)" srcSet={`${buildNodeUrl(image)}?w=960`} />
  <img src={`${buildNodeUrl(image)}?w=480`} alt={alt} style={{ width: '100%' }} />
</picture>

In JSP:

<picture>
  <source media="(min-width: 960px)" srcset="${image.getUrl()}?w=1920" />
  <source media="(min-width: 480px)" srcset="${image.getUrl()}?w=960" />
  <img src="${image.getUrl()}?w=480" alt="${alt}" style="width: 100%" />
</picture>

These two samples work the same for end users: the browser requests three variants of the same image (480px, 960px, and 1920px) and displays the most appropriate one.

Known Bugs

When using srcset with multiple candidates, you may encounter a rewriting issue if one image URL is a substring of another (e.g., srcset="image.png?w=480 480w, image.png 960w").

In this case, ensure that all URLs are unique, for example by adding the original image size to the URL: srcset="image.png?w=480 480w, image.png?w=960 960w".