User Manual - Minifier

The Minifier extension is one of the solutions for optimizing your content in an online store powered by Magento 2. This extension compresses image size, converts images from PNG to JPG, automatically generates image titles. After optimization, all original images will be stored on the server for 30 days, in order of unsatisfactory results to do a rollback.

Compatibility: Magento Open Source 2.3.X - 2.4.X

Installing Magento 2 Minifier

Command Line Installation

  1. Backup your web directory and store database
  2. Download the Minifier installation package
  3. Upload contents of the Minifier installation package to your store root directory
  4. In SSH console of your server navigate to your store root folder:

cd path_to_the_store_root_folder


php -f bin/magento module:enable Aheadworks_Minifier


php -f bin/magento setup:upgrade


php -f bin/magento setup:static-content:deploy

     5. Flush store cache; log out from the backend and log in again

Make sure the installation is done from the FTP administrator account. Otherwise, set 775 permissions to the store root directory after the extension is deployed.

Composer Installation

If you are installing an extension from Aheadworks for the first time, you need to add our composer repository to your Magento store:

     1. Login to your ssh console and navigate to your store folder:

cd path_to_the_store_root_folder

Run the following command:

composer config repositories.aheadworks composer

On successful execution of the commands you will be able to use the composer to install the extensions.

To install the extension:

     2. Login to your ssh console and navigate to your store folder:

cd path_to_the_store_root_folder

      3. Run the following command to install the latest version of the extension:

composer require aheadworks/module-minifier

if you need to install a specific version, run this command:

composer require aheadworks/module-minifier:<version>


Specify the version of the extension in <version>

When prompted, enter Composer Public Key (Username) and Private Key (Password):

Composer Public Key (Username) and Private Key (Password) | Minifier for Magento 2

Both Composer Public Key (Username) and Private Key (Password) can be found in My Projects and Licenses in your personal account on our site:

access keys management | Minifier for Magento 2

 4. Enable the extension:

php -f bin/magento module:enable Aheadworks_Minifier

Next, register the extension:

bin/magento setup:upgrade

Recompile your Magento store if you are in the Production mode:

bin/magento setup:di:compile

To verify that the extension is enabled, run this command:

bin/magento module:status

Clean store cache, by running the following command:

bin/magento cache:clean

Log out and Log in the backend again.

To upgrade the extension:

     5. To update or upgrade an extension:

Download the updated extension file. Take note of the module-name and version. Export the contents to your Magento root.

If a composer package exists for the extension, run one of the following.

Update per module name:

composer update aheadworks/module-minifier

Updater per version:

composer require aheadworks/module-minifier:<version>

Run the following commands to upgrade, deploy, and clean the cache.

php bin/magento setup:upgrade --keep-generated 
php bin/magento setup:static-content:deploy
php bin/magento cache:clean



Manual Removal

1. Disable the module by executing the following commands:

php bin/magento module:disable Aheadworks_Minifier 
php bin/magento setup:upgrade

2. Remove the extension files from the following folder:


Automatic Removal (via Composer)

1. Disable the module by executing the following commands:

php bin/magento module:uninstall Aheadworks_Minifier




Introducing Magento 2 Minifier

The Minifier extension makes working in an online store as easy as possible by offering the following options:

  • Images compression
  • Manual or automatic image optimization
  • Lossy or lossless compression
  • Conversion from PNG to JPG
  • File names optimization
  • Page preview

General Information

Authorizing to Minifier

Before starting to work with the extension you need to enter the authorization keys by going to Stores → Configuration → Aheadworks Extensions → Minifier. Two keys are required: Public and Private API.

You can find Public and Private API keys in My Projects and Licenses in your personal account on

Authorizing to Minifier | Minifier for Magento 2

Enable prefetching

To enable prefetching in Minifier, set Enable to Yes. By default, this option is set to No. Minifier will track when a user is about to click on a link on your shop and load that link in the background.

Enable prefetching | Minifier for Magento 2

Minifier on Backend

The dashboard has four areas:

  • Images optimized
  • Image weight reduce by
  • Average product load time decreased by
  • File names optimized
How does your website perform on various networks?

To find out how does your website performs on different networks, click on the question mark. In the table down below you will see information on how your average product page, as well as the entire store, would perform on two most commonly used networks - 4G and household WiFi.

Minifier on Backend | Minifier for Magento 2
Clicking on the Review us button you will be automatically redirected to the Minifier product page on Shopify app store.

Review us button | Minifier for Magento 2

Settings Configuration

The Automatic optimization service tab provides information about the number of already optimized images. For changing optimization configurations click on Edit setting.

Automatic optimization process goes via the Kraken. Where customers’ images are processed in order and loaded back in the amount of 250 images at a time.

Settings Configuration | Minifier for Magento 2

The settings area allows to configure the following:

  • lossy or lossless kind of compression - lossy compression will reduce the image size by up to 70%, losing a little in quality; lossless compression will reduce the image size by up to 30%
  • optimize only published products - Minifier will skip images that don't need to be optimized, which will speed up the optimization process
  • convert files to JPG - images saved in JPG load faster than in PNG
  • skip previously optimized images - previously compressed images will not be compressed
  • optimize file names automatically - for higher search engine rankings, filenames must be supplied by keywords. If this configuration is switched on, Minifier will combine image titles from the file data such as PRODUCT TYPE and PRODUCT TITLE. When PRODUCT TYPE is unavailable, the image title will be made from PRODUCT TITLE only.

After clicking on the Save settings button new settings will be saved and will be used in the future for the auto-optimization process for not optimized store pictures.

When the new settings are saved, auto-optimization process will start immediately. 

Auto-optimization process | Minifier for Magento 2

Optimization performance

The images optimized graph introduces the information on the extension usage. Choose the needed period to check the number of optimized images during it.

Optimization performance | Minifier for Magento 2

The Optimization History area contains the following columns:

  • Type – the name of the report
  • Status – the condition of an optimization process:
    • collecting;
    • collected;
    • optimizing;
    • optimized;
    • pushing;
    • done;
    • reverting;
    • reverted;
    • not enough images left;
    • shop deleted Minifier;
    • no new images found.
  • Date – when optimization was complete
  • Images – how many images were optimized
  • Saved – how much space was saved after optimization.

Optimization History  | Minifier for Magento 2

To view the report on optimization click on the link. The report describes the detailed information on:

  • Created date
  • Closed date
  • Collected images
  • Previously optimized images
  • Images optimized using lossy algorithm
  • Optimized images published to the store
  • Saved KBs

Auto Optimization | Minifier for Magento 2

Knowledge Base

The Frequently Asked Questions area introduces answers for most asked questions about the working process in Minifier.

  • Lossless or lossy. Which one to use?

  • If I stop using Minifier, what will happen to my images?
  • Why are file names important?
  • What is the difference between auto-optimization plans?
  • What if I don’t like changes?
  • Why do I need to browse my store after enabling prefetch?
  • For detailed information click on one of the following questions.

Frequently Asked Questions area | Minifier for Magento 2 

Optimization results

When the optimization is complete, you may check the results, proceeding, for example, to the image gallery of any product and see how the size changed without quality loss.

Optimization results | Minifier for Magento 2


Minifier | Minifier for Magento 2

Product Page

Report incorrect information

Still Have Questions?

Our customer care team is here for you!

Contact Us