Skip to main content

Installing the extension

Use these steps to install the extension on your store.

Prepare for installation​

  1. Back up your store's database and web directory.
  2. Log in to the SSH console of your server and navigate to the root directory of the Magento 2 store.
  3. Copy the installation instructions from the page My Downloadable Products to the SSH console and press ENTER.
Note

To manually install the module in the app/code/ directory, download the archive from My Downloadable Products -> View & Download, unpack it, and copy the contents to Magento's root directory. Then, access your server via SSH, navigate to the Magento 2 root, and follow the installation steps.


Execute the following set of commands to install​

  1. Run the command to enable the extension:

    php -f bin/magento module:enable Mirasvit_Core Mirasvit_CacheWarmer Mirasvit_Report
  2. Run the command to install the extension:

    php -f bin/magento setup:upgrade
  3. Run the command below to set up dependencies:

    php -f bin/magento setup:di:compile
  4. Run the command for clean cache:

    php -f bin/magento cache:clean
  5. Deploy static view files:

    rm -rf pub/static/*; rm -rf var/view_preprocessed/*;
    php -f bin/magento setup:static-content:deploy

If you are using the Hyvä theme​

Hyvä support ships with the extension, so there is nothing extra to install or build: the storefront debug toolbar and the cache test page work on Hyvä as they do on Luma.

Note

Until version 1.12.0 Hyvä support was a separate package, mirasvit/module-cache-warmer-hyva. If it is still installed on your store, upgrading the extension removes it by itself. See How to upgrade extension.

If you want to upgrade the extension, please refer to the How to upgrade extension section. To temporarily disable or remove it, use the commands from the How to disabling extension section.


APCu and OPcache​

The extension works the same with or without APCu and OPcache, and needs no extra settings for them. It does not use APCu directly: it stores and checks pages through Magento's standard cache framework.

These tools and the full page cache speed up different things:

ToolWhat it storesWhat it speeds up
OPcachecompiled PHP codeevery PHP request, because PHP files are not compiled again
APCuPHP data in shared memory (for example, the Composer class map when you use composer dump-autoload --apcu)PHP code that reads this data
Full page cachefinished HTML pagespages that are already in the cache, which are returned without running Magento code

OPcache and APCu make Magento render an uncached page faster (lower server response time, TTFB). The warmer makes sure that visitors get a page from the full page cache, so Magento does not need to render it at all. You can use them together.

Composer autoloader options​

Adobe recommends optimizing the Composer autoloader in production. The extension works with all the options below, but one of them needs a correct deployment order:

OptionCommandUse with Magento
optimize-autoloadercomposer dump-autoload -oSafe and recommended. Composer builds a class map, and a class that is not in the map is still found the usual way.
apcu-autoloadercomposer dump-autoload -o --apcuSafe when the APCu extension is enabled. Composer also keeps in APCu whether each class was found.
classmap-authoritativecomposer dump-autoload -aUse with care. Composer loads only the classes that are in the class map.

classmap-authoritative and apcu-autoloader cannot be used together, so choose one of them.

bin/magento setup:di:compile generates classes (interceptors, factories, and proxies) in the generated/code directory, including the classes for this extension's plugins. With classmap-authoritative, a generated class that is not in the class map is not found by Composer, so Magento tries to generate it again while the store is running. This slows the store down, and if the generated directory is read-only, pages fail with an error.

To avoid this, always build the class map after setup:di:compile, and build it again every time you run setup:di:compile. Adobe recommends the following order:

composer install --no-dev
bin/magento setup:di:compile
composer dump-autoload -o --apcu
bin/magento setup:static-content:deploy

If you use classmap-authoritative, replace -o --apcu with -a in this sequence.