Using the Sirv extension for Magento

On this page

The Sirv CDN extension for Magento 2 is the best way to optimize and deliver your images rapidly. It can also replace your default media gallery with Sirv Media Viewer, to conveniently showcase 360 spins, videos and zoomable images.

Use the Sirv CDN extension to:

  • Optimize product images, WYSIWYG images, JS, CSS and static files.
  • Deliver these files rapidly in next-gen formats (e.g. WebP) from Sirv's CDN.
  • Resize images on-the-fly and lazy load them.
  • Use Sirv Media Viewer for 360 spins, product video & image zoom.

Learn more about the Magento CDN extension key features.


  1. Download the Sirv Magento 2 extension (zip) or the Magento 2 image CDN extension Marketplace page.

  2. Go to System > Web Setup Wizard in your Magento admin and click the Component Manager link.

  3. Find the Sirv component in the list and click “Enable”.

    Alternatively, activate the module from the command line:

    php -f bin/magento module:enable MagicToolbox_Sirv --clear-static-content
    php -f bin/magento setup:upgrade
    rm -rf var/generation
    php -f bin/magento setup:di:compile
    php -f bin/magento setup:static-content:deploy
  4. Log in to your existing Sirv account or create a new one:

    Magento Sirv registration

You'll be granted 5 GB storage and 20 GB bandwidth for 30 days. After your free trial expires, you may choose a paid plan or a free one (500 MB storage, 2 GB bandwidth and branding on Sirv Media Viewer).

How to set up a CDN in Magento 2

  1. Go to the Sirv extension options, via System > Sirv CDN > Configuration:

    Sirv Settings Location
  2. Sirv will synchronize your media gallery automatically, when unsynced images are requested. This typically takes 1-2 seconds per image. Alternatively, you can click "Sync Media Gallery" to pre-sync your media gallery:

    Sirv General settings in Magento 2

    Your media gallery images will start uploading to Sirv:

    Sirv General settings in Magento 2

    The Sirv CDN extension for Magento will automatically stay in sync by copying new images to your Sirv account on first request. Once on Sirv, images are resized, optimized, cached and served by our Magento CDN. We don't recommend pre-syncing your gallery when testing but do recommend it before going live, for the fastest possible user experience.

  3. Enable Sirv:

    Sirv General settings in Magento 2
  4. Select your preferred network:

    Sirv Network optons in Magento 2

    We recommend serving images from Sirv's primary datacenter during testing, since you'll bypass the CDN cache. For production websites, use Sirv CDN - it will deliver images from the closest server to each visitor, via Sirv's global CDN.

  5. Pick a folder name to sync your Magento media to:

    Sirv Network optons in Magento 2
  6. Choose a profile (optional):

    Profile optons in Magento 2

    Profiles are one of Sirv's powerful features, to apply transformations to images. You can tweak image quality, format, text overlays, watermarks and many other options, without altering your original images.

  7. Choose "Yes" in the "Serve CSS, JS & static files" setting. This will automatically sync your JS, CSS and static files to Sirv. They will be minified automatically and delivered rapidly from Sirv's CDN.

  8. Click the "Save Settings" button:

    Sirv Extension Save settings button in Magento 2

ImportantRefresh your Magento page cache after modifying settings, to ensure you see the latest changes.

Congratulations, Sirv is now running on your Magento store! Enjoy the best possible image optimization, next-gen image formats and lightning-fast CDN page loading.

You can replace your default Magento product gallery with the sophisticated Sirv Media Viewer, enabling you to add 360 spins, videos and additional images to your product gallery. It's highly customizable, optimized for speed and provides an outstanding mobile experience.

Here's a live demo:

How to add zoom, 360 spins and videos to Magento 2

  1. Choose the Sirv Media Viewer option:

    Sirv Media Viewer in Magento 2
  2. Select the source for the media to be included in your gallery - either Magento, Sirv or both:

    Sirv Media Viewer order of content in Magento 2

    Uploading directly to Sirv is popular because it's fast and easy. Unlike Magento, Sirv supports all types of media - 360 spins, streaming videos and 8 types of image zoom.

  3. Select the folder naming convention that you will use to upload media directly to Sirv. Use either {product-sku} or {product-id} convention:

    Sirv Media Viewer assets folder setting in Magento 2

    Create a master folder in your Sirv account, for example, a folder named 'products':


    Then create subfolders for each product, naming each one to match your SKUs or product IDs. A product with SKU 24-MB01 would be:


    Then upload the 360 spins, videos and images for that product, for example:


    TIP: Automate itUse the S3 API to create and upload files programmatically.

    Here's how the folder might look in Sirv:

    Sirv folder screenshot

    Flush the asset info cache in Sirv settings and remember to refresh Magento's page cache too:

    flush asset info cache

Job done.

Here's how Sirv Media Viewer might look on the front-end:

Sirv Media Viewer on Magento Front front-end


Sirv Media Viewer is very customizable. You can change plenty of zoom, 360 spin, video options, as well as viewer options.

For really easy configuration, we've created a live interactive demo, for you to tweak every single option and copy the configuration code.

Sirv Media Viewer options in Magento

Paste the resulting code into the "Sirv Media Viewer" options text box:

Sirv Media Viewer options in Magento

Usage stats

A summary of your storage, transfer and API usage is shown on your Sirv settings page:

Sirv Stats in Magento 2

For detailed statistics, visit your Analytics page.


The Sirv support team is ready to help you. As Magento experts, they can install the extension for you, assist you with customization, or configure Sirv on highly customized Magento sites. Contact the team with your requirements.


  • v3.2.2
    August 5, 2020

    Improved support for third-party modules.
    Improved Auto-Fetch feature.
    Small bug fixed.

  • v3.2.1
    July 23, 2020

    Added 'Image quality' option.
    Added 'Max height' option.
    Small bug fixed.
    Improved module settings page.
    Added small performance improvements.

  • v3.2.0
    July 6, 2020

    Added Auto-Fetch feature for JS, CSS & static file CDN serving.
    More elegant module settings page.
    Improved the module menu.
    Better upgrade notification.
    Small bug fixed.

  • v3.1.2
    June 16, 2020

    Improved support for third-party modules.
    Small bug fixed.
    Improved module settings page.

  • v3.1.1
    June 9, 2020

    Added field for configuring Sirv Media Viewer options.

  • v3.1.0
    June 5, 2020

    Improved support for third-party modules.
    Improved module settings page.
    Improved synchronization process.
    Minor bug fixes.

  • v3.0.3
    May 26, 2020

    Improved synchronization process.

  • v3.0.2
    May 21, 2020

    Improved support for Magento v2.2.

  • v3.0.1
    May 13, 2020

    Improved support for Sirv Media Viewer.
    Small bug fixed.

  • v3.0.0
    May 1, 2020

    Added support for CMS block images.
    Added support for Sirv Media Viewer.
    Improved module settings page.
    Improved synchronization process.
    Added account creation form.

  • v2.1.0
    February 14, 2020

    Improved support for Magento v2.3.
    Improved support for other MagicToolbox modules.
    Improved synchronization process.
    Small bug fixed.

  • v2.0.5
    November 29, 2019

    Improved module settings page.
    Minor bug fixes.

  • v2.0.4
    November 12, 2019

    Improved synchronization process.

  • v2.0.3
    November 8, 2019

    Added warming the cache by prefetching DNS.
    Improved module settings page.
    Minor bug fixes.

  • v2.0.2
    October 9, 2019

    Improved module settings page.

  • v2.0.1
    October 8, 2019

    Improved support for Magento v2.1.

  • v2.0.0
    October 7, 2019

    Added REST API integration.
    Optimized S3 usage.
    Small bug fixed.
    Improved module settings page.

  • v1.1.10
    August 13, 2019

    Improved synchronization process.

  • v1.1.9
    July 17, 2019

    Optimized flushing cache process.

  • v1.1.8
    July 16, 2019

    Small bug fixed.

  • v1.1.7
    July 15, 2019

    Optimized CDN usage.

  • v1.1.6
    April 18, 2019

    Optimized S3 usage.

  • v1.1.5
    February 13, 2019

    Improved support for PHP 5.

  • v1.1.4
    February 11, 2019

    Improved support for Magento v2.0, v2.1, v2.2.

  • v1.1.3
    February 5, 2019

    Fixed an issue with Magento 'Minify JavaScript Files' option.
    Improved compatibility with Magento v2.3.
    Fixed an issue with spaces in 'Folder name on Sirv' option's value.
    Fixed an issue with non-alphanumeric characters in watermark url.

  • v1.1.2
    November 29, 2018

    Optimization of S3 usage.

  • v1.1.1
    November 6, 2018

    Optimization of sync process.

  • v1.1.0
    September 28, 2018

    Improved caching.
    Improved module settings page.

  • v1.0.9
    September 4, 2018

    Optimized gallery synchronization.

  • v1.0.8
    June 27, 2018

    Improved media gallery synchronization.

  • v1.0.7
    May 30, 2018

    Added support for category images.

  • v1.0.6
    May 18, 2018

    Added support for Magento v2.2.4.
    Improved support for Magic360 module.

  • v1.0.5
    May 10, 2018

    Added button to synchronize media gallery.

  • v1.0.4
    April 10, 2018

    Fixed an issue with empty 'Folder name on Sirv' option.
    Fixed an issue with getting buckets list when user has multiple account names.
    Fixed an issue with caching image urls in some Magento version.

  • v1.0.3
    December 12, 2017

    Fixed an issue with uploading already cached images.

  • v1.0.2
    October 31, 2017

    Added support for Magento v2.2.0.

  • v1.0.1
    October 18, 2017

    Improved module settings page.

  • v1.0.0
    June 6, 2017

    Sirv module for Magento 2 created.

How to set up a CDN for Magento 1

ImportantWe continue to provide support for our Magento 1 extension, though new feature development is focussed on Magento 2, so we recommend migrating to Magento 2.

  1. Download the Sirv Magento 1 extension (zip).

  2. Unpack the zip file to your computer, then upload it to your Magento server.

  3. Refresh the Magento cache.

  4. Create your Sirv account.

  5. Go to System > Sirv CDN and connect your Sirv account.

    Sirv login in Magento 1
  6. The extension will start working as soon as you have set "Enable Sirv" to "Yes" and saved your settings.

    Sirv settings in Magento 1

Was this article helpful?

Related articles

Get help from a Sirv expert