Documentation

Implementation Overview

ImageEngine is a pull-based Image CDN that will pull an image from its origin on demand and optimize it.

# Key Elements of an Engine

CNAME your own domain

Engine: an Engine is a relationship among the Delivery Address, an ImageEngine Address, and an Origin to handle requests and deliver optimized images.

Delivery Address: A Delivery Address is where you should direct requests for images. Standard and Pro account users can customize the Delivery Address to have an address from a domain that you own. If you do not customize the Delivery Address, then the Delivery Address is identical to the ImageEngine Address.

ImageEngine Address: The ImageEngine Address handles your account’s images on the imgeng.in domain. You should only use the ImageEngine Address when customizing the Delivery Address and setting up a DNS CNAME record that will pass requests from the custom Delivery Address (CNAME) to the ImageEngine Address.

Origin: The origin is where you store your images. You can store your images on a web server accessible via HTTP or HTTPS, or cloud-based storage. ImageEngine does not need you to move or upload images anywhere.

how it works

If an optimized version of the image that is tailored to the requesting device is already cached on the edge server, then ImageEngine will deliver it immediately. ImageEngine’s edge servers will store several optimized images based on the capabilities of the requesting devices or browsers, each with a unique cache key.

If an optimized image is not in ImageEngine’s cache (typically the very first time an image is requested), then ImageEngine will fetch the image from the origin. ImageEngine will resize, compress and convert the image into its optimal format. During these first optimizations, ImageEngine will serve the original (unoptimized) image until the ImageEngine cache is “warmed” or “primed” to avoid any delays for the user. Therefore, you should send a fair amount of traffic and monitor the cache hit rate before evaluating the effectiveness of the image payload optimization and page load time.

Once fully operational, the ImageEngine CDN cache typically handles 98% of the traffic, while the origin servers see only 2% of the actual traffic.

# Integration Methods

To implement ImageEngine on your website, you have two options for directing traffic to ImageEngine by updating img src tags: the Delivery Address Method and the Prefix Method.

# 1. Delivery Address Method

how it works

Once you have set up your account, you have configured an Engine that includes a Delivery Address. Find the Delivery Address in the left column of the Account Summary> Engine Table.

To start optimizing images, you must modify your img src attributes to direct requests to the Delivery Address. Copy the Delivery Address, and insert it into the img src attribute.

For example, original image src attribute was <img src="//www.foo.com/image.jpg"> and your Delivery Address is images.foo.com, then you will modify your image src attribute to <img src="//images.foo.com/image.jpg">

Note that the procedure is the same even if you choose to use the ImageEngine address directly as your Delivery Address instead of using a custom Delivery Address (CNAME).

how it works

# Basic Account Delivery Address

By default, a Basic account user’s Delivery Address is identical to your ImageEngine Address. ImageEngine will assign an ImageEngine Address and Delivery Address to look something like this: zzzxxxyyy.cdn.imgeng.in, where the first part is a randomly generated value. HTTPS is supported out of the box. If you want to customize your Delivery Address, then you will need to upgrade to a Standard or Pro account by contacting us here.

For the above Basic account, here is an example of how to modify the img src attribute

Original image src attribute was <img src="//www.foo.com/image.jpg">

Your Delivery Address (and ImageEngine Address) is zzzxxxyyy.cdn.imgeng.in, then you will modify your image src attribute to <img src="//zzzxxxyyy.cdn.imgeng.in/image.jpg">

# Standard or Pro Account customized Delivery Address

You may want to serve images from a customized Delivery Address that comes from a domain that you own. If you have a Standard or Pro account, then you can add a customized Delivery Address when you create a new Engine. You must also add a CNAME record in your DNS, generating an alias from the Delivery Address (your domain) to the ImageEngine Address.

For example,

When creating an Engine for www.foo.com, ImageEngine will set both the ImageEngine Address and Delivery address to www.foo.com.imgeng.in by default.

Follow the instructions for customizing your Delivery Address here.

# 2. Prefix Method

how it works

You can prefix any image origin URL with a Delivery Address regardless if it is a custom domain or an ImageEngine Address.

how it works

This is a great option if you have multiple origins you want to serve through the same Delivery Address. It is also a great method for testing ImageEngine with different environments. In the control panel it is possible to restrict which origins can be prefixed.

For example. if original image src attribute was <img src="https://www.foo.com/image.jpg"> and your Delivery Address with HTTPS is images.foo.com, then you will modify your image src attribute to <img src="https://images.foo.com/image.jpg">