defer_javascript

View Magento 2 Defer Javascript Extension Detail Page for Features and Demo

Documentation for Defer Javascript

Preference

Magento 2 Defer JavaScript Extension is one of the most powerful factors that help to improve the web sites speed.

  • This module is useful for reducing the loading time of a website so customers can enjoy a well shopping experience on your store.

Installation

There are two ways of installing extension in magento2.

  1. Using COMMAND LINE.
  2. Manually Install extension.

Option 1: Magento 2 install extension using COMMAND LINE (Recommended)

Follow below steps to install extension from the command line.

Step 1: Download the extension and unzip it.

Step 2: Upload it to code directory in your magento installation’s app directory. If code directory does not exists then create.

Step 3: Disable the cache under System → Cache Management.

Step 4: Enter the following at the command line:

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

Step 5: Once you complete above steps log out and log in back to the admin panel and switch to Stores → Configuration → Mageants → Defer Js, The module will be displayed in the admin panel.

Option 2: Magento 2 install extension manually

Step 1: Download the extension and unzip it.

Step 2: Upload it to code directory in your magento installation’s app directory. If code directory does not exists then create.

Step 3: Disable the cache under System → Cache Management Edit app/etc/config.php file and add one line code: ‘Mageants_Deferjs’ → 1

Step 4: Disable the cache under System → Cache Management

Step 5: Once you complete above steps log out and log in back to the admin panel and switch to Stores → Configuration → Mageants → Defer Js, the module will be displayed in the admin panel.

Backend Example

  • After Installation of Extension go into Magento admin panel for set configuration of the extension.
  • After Installation of Extension Go to Store → Configuration → Mageants → Defer Js Configuration And Enable Module Set “Yes” option.

Defer IFrames :

  • Unordered List ItemIf you Selecting Yes, then embedded code using IFrame tag of your web site is loading only when your site finishes loading completely. This thing will cause defer score of your website decrease or the site does perform fast enough for better customer experience.

Exclude Controller :

  • Write down your wished controllers and click Add Match button that you want to disable Defer Js for Magento 2.

Exclude Paths :

  • Write down your wished paths or controllers and click Add Match button that you want to disable Defer Js for Magento 2.

Show Controllers And Paths :

  • Show Current page Controller and path in end of the page.

Exclude Home Page :

  • After selecting yes, the Home page will be unaffected by deferring JavaScript.

Put JavaScript In HTML Body Tag :

  • After selecting yes, JavaScript call in HTML body tag.

Frontend Example

  • After Show Controllers And Paths selecting Yes, you can find information about the Current Controllers / Paths in the table at the end of the frontend page:

defer_javascript.txt · Last modified: 2025/05/26 07:27