# Basic implementation

This simple and fast implementation in Magento 2 enables JPEG optimization, WebP compression and CDN delivery of your images.

## Prerequisites <a href="#od_d63bc98a" id="od_d63bc98a"></a>

To use the plugin, you need to have a Cloudimage account. You can create one on the [Cloudimage registration page](https://www.cloudimage.io/registration).\ <br>

<figure><img src="https://content.gitbook.com/content/IDIcmPiz7q6Sr6ZHHQxV/blobs/IX5K7BZHUxDV69vk12j8/image.png" alt=""><figcaption></figcaption></figure>

## Step 1. Login to Magento <a href="#od_6b1db122" id="od_6b1db122"></a>

First, you need to log in to your Magento 2 website admin

<figure><img src="https://content.gitbook.com/content/IDIcmPiz7q6Sr6ZHHQxV/blobs/KzsZRiVPTPaRunlmCJCw/ms2.png" alt=""><figcaption></figcaption></figure>

## Step 2. Configure the plugin <a href="#od_410d6e5f" id="od_410d6e5f"></a>

On the *Admin* sidebar, go to *Stores* > *Settings* > *Configuration*.

<figure><img src="https://content.gitbook.com/content/IDIcmPiz7q6Sr6ZHHQxV/blobs/1JmWJnAghTXACNaqBB49/ms3.png" alt=""><figcaption></figcaption></figure>

Navigate to the settings page - from the left panel, in the *General* group, choose *Web*.

<figure><img src="https://content.gitbook.com/content/IDIcmPiz7q6Sr6ZHHQxV/blobs/ZRPXkZNVTljZ4NVfPn1N/ms4.png" alt=""><figcaption></figcaption></figure>

Then, you need to set up the Base URLs.

It is important to set this prefix in both - *Base URL for User Media Files* and *Secure Base URL for User Media Files*.

In Base URL for *User Media Files* in *Base URLs* and *Base URLs (Secure)* add the following value, replacing your token: `https://<token>.cloudimg.io/{{secure_base_url}}pub/media/`

<figure><img src="https://content.gitbook.com/content/IDIcmPiz7q6Sr6ZHHQxV/blobs/T5UA1QKVQDboMIdEtBrk/ms5.png" alt=""><figcaption></figcaption></figure>

For example, if your website is `https://sfxmagento.site`, and your token is `demo`, the final URL address should be: `https://demo.cloudimg.io/https://sfxmagento.site/pub/media/`

You can also use your own domain instead of {token}.cloudmg.io via CNAME records. Please [contact us](https://www.cloudimage.io/contact-us) and an engineer will help setting it up.

When complete, do not forget to click *Save Config*.

## Step 3. Flush the cache of Magento <a href="#od_2dab3d6f" id="od_2dab3d6f"></a>

On the Admin sidebar, go to System > Tools > Cache Management and Flush the cache of Magento.

<figure><img src="https://content.gitbook.com/content/IDIcmPiz7q6Sr6ZHHQxV/blobs/jZHNFiy2jSDPHdoiLKzk/ms6.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/IDIcmPiz7q6Sr6ZHHQxV/blobs/6ZO7s1w8oSK1AhYXaiLA/ms7.png" alt=""><figcaption></figcaption></figure>

Magento’s cache management system is an easy way to improve the performance of your site. Whenever a cache needs to be refreshed, a notice appears at the top of the workspace to guide you through the process. Find additional information and tips in this [Magento tutorial for cache management](https://docs.magento.com/m2/ce/user_guide/system/cache-management.html).

## Verify your HTML page source <a href="#od_5e70eebd" id="od_5e70eebd"></a>

Please ensure that you are properly delivering static content via the CDN.

<figure><img src="https://content.gitbook.com/content/IDIcmPiz7q6Sr6ZHHQxV/blobs/iRcoEFlr0sfChpm41D2J/ms8.png" alt=""><figcaption></figcaption></figure>

You can now modify your template to resize your images with us.
