How to deploy the Image Optimization template


Image Optimization includes configurations for enhancing image loading and caching based on file extension. These configurations use advanced cache key rules that are applied through Rules Engine for Edge Application.

You must link your origin with the template to start using this set of cache rules for delivery. After the deployment, the script creates a new edge application that runs on Azion’s Edge Computing Platform, with which you can manage and adjust the settings.

The file extensions that can be enhanced with these configurations are .jpg, .jpeg, .bmp, .ico, .gif, .png.

To use this template, you must activate:

Edge Functions

Application Acceleration

You need to activate these modules via Real-Time Manager (RTM). To do so:

  1. Access Real-Time Manager (RTM) > Account menu
  2. Select the Billing & Subscriptions option.
  3. Select the Subscriptions tab.
  4. Activate the switch for each module.

To use this template, access Real-Time Manager (RTM) and select the Start with a template option on the homepage.

This will open a new page where you can select the Image Optimization card.

Once you’re in the template’s page, click the Settings tab to open the configuration form and provide the information to configure your application.

Fields identified with an asterisk are mandatory.

  • Application Name *: the name of your edge application on Azion.
    • Use a unique and easy-to-remember name. If the name has already been used, the platform returns an error message.
  • Origin Address *: the address of the hosted origin the edge application should fetch the original content from.
    • Example:
  • Custom Host Header: in some cases, it may be necessary to add host information in the header request to retrieve information from the origin. This variable is used for that purpose.
    • Example: ${host}. Read more about the host header and how to customize it on the Origins documentation.
  • Static file extensions to cache *: the file extensions for the rules, separated by a comma. You can add as many variables as you need, based on the example.
    • Example: jpg,jpeg,bmp,ico,gif,png
  • CDN Static Maximum TTL *: a maximum TTL (time-to-live), in seconds, for cached content to be delivered.
    • Accepts values from 0 to 31536000. Default value: 31536000
  • Browser Image Maximum TTL *: a maximum TTL (time-to-live), in seconds, for cached content in the browser.
    • Accepts values from 0 to 31536000. Default value: 0

After completing all the information, click the Next button, located in the bottom-right corner. This will start the deployment process.

You’ll be able to follow the deployment process through a window showing off the logs. When it’s complete, the deployment page appears, confirming the edge application has been successfully created.

This page shows you the following sections:

  • Access your Edge Application section includes the Azion domain to visit and explore your edge application.
  • Build Summary contains the application’s name and function.
  • The Deployment details tab can be opened to access the logs related to the deployment.
  • What do you want to do next? provides recommendations regarding advanced options to enhance your edge application: Customize Domain, Manage Edge Application, View Edge Application Metrics, View Edge Application Logs, and the Back to Home button.

Now, you can you can manage and adjust the settings through this new Azion edge application.

Considering that this initial setup may not be optimal for your specific edge application, all settings can be customized any time you need by using RTM.

To manage and edit your edge application’s settings, proceed as follows:

  1. Access RTM.
  2. On the upper-left corner, select Products menu > Edge Application.
  • You’ll be redirected to the Edge Application page. It lists all the edge applications you’ve created.
  1. Find the edge application related to the Image Optimization template and select it.
  • The list is organized alphabetically. You can also use the search bar located in the upper-left corner of the list; currently, it filters only by Application Name.

After selecting the edge application you’ll work on, you’ll be directed to a page containing all the settings you can configure.