1 Magento Setup Upgrade:
You only need to call setup:upgrade if you’ve installed a new module or if you’ve made changes to the /setup/ directory of your module. Magento Setup Upgrade Command checks the module version in setup_module table. If the version is not available or a new version is specified in module.xml, the command runs the setup script and adds the latest version number to the table.
This command is necessary for many situation when InstallData, InstallSchema, UpgradeData, UpgradeSchema, After upgrading Magento Version, first Magento Instalation and the new Module Installation.
Command –
1 | php bin/magento setup:upgrade or php bin/magento s:up |
2 Magento Compilation:
The Magento Compilation feature that is designed to improve the performance of your online store. The Compilation command is responsible mainly for 2 tasks: CODE GENERATION and CODE COMPILATION. This feature allows you to compile all Magento installation files (source code, including plugins) into a single folder in order to create a single include path.
When the app is in Production mode, this command should run each time the changes have been made especially related to the PHP. However the compilation command does not need to be run when the app is in the Developer Mode because in this mode the Magento uses automaic code generation.
Command –
1 | php bin/magento setup:di:compile or php bin/magento s:d:c |
3 Magento Content Deploy:
Deployment of static content is a great way to boost the speed of your Magento 2 store.
The static view files deployment command enables you to write static files to the Magento file system when the Magento software is set for production mode.
The term static view file refers to the following:
“Static” means it can be cached for a site (that is, the file is not dynamically generated). Examples include images and CSS generated from LESS.
“View” refers to presentation layer (from MVC).
Static view files are located in the /pub/static directory, and some are cached in the /var/view_preprocessed directory as well.
Modes Affecting Magento 2 Static Content Deployment
Production mode
Default mode
Developer mode
Command-
1 | php bin/magento setup:static-content:deploy or php bin/magento s:s:d |
4 Magento Cache Flush:
Magento 2 Cache Flush Command is required for Cleaning all the cache types collected in storage. It may affect other processing applications that run the same cache storage.
Command –
1 | php bin/magento cache:flush or php bin/magento c:f |
5 Magento Indexing:
Indexing is how Magento transforms data such as categories and products, to improve the performance of your storefront. As data changes, the transformed data must be updated or reindexed. Magento has a very complex architecture that stores lots of vendor data (including catalog data, prices, users, and stores) in many database tables. To optimize storefront performance, Magento collect data into special tables using indexers.
Without indexing, Magento would have to calculate the price of every product on the fly, taking into account shopping cart price rules, bundle pricing, discounts, tier pricing, etc. Loading the price for a product would take a long time, possibly resulting in cart abandonment.
Command –
1 | php bin/magento indexer:reindex or php bin/magento i:rei |