Skip to content

Blog

How to Enable and Clear the Cache in Magento 2

Magento 2 features a powerful internal caching system. Enabling this cache ensures the best site speed and page load times, allowing customers to navigate the catalog and create orders quickly. Site caching simply creates better order transactions and less abandoned carts. To enable enable all Magento 2 Cache Types via command line, navigate to your site’s document root and type the following command: bin/magento cache:enable To check the status of Magento 2’s cache, type the following command: bin/magento cache:status To disable Magento 2’s Cache, type the following command: bin/magento cache:disable To clear Magento 2’s cache, type the following commands: bin/magento… Read More »How to Enable and Clear the Cache in Magento 2

Increase PHP Memory When Running Magento 2 Command

When running CLI commands on a Magento 2 installation the issue of memory can arise. For example, when running a composer command the memory limit will sometimes be reached, generating an error and the command being terminated. The ability to increase the PHP memory limit for that command only is needed. The following command is an example where I need to run upgrade composer, but need to increase the memory limit 2048 MB. php -d memory_limit=2048M /bin/composer upgrade

Create a Magento 2 Site Backup for Local Development

I often have to create a quick copy of a Magento 2 site to store on my local machine for development. Typically I only need the core files, extensions, themes, etc. Skipping the folders in the Magento 2 filesystem that aren’t needed for development will save a lot of disk space. The command below quickly creates a tar.gz backup of a root Magento 2 directory, skipping folders that aren’t relevant for local storage. Via SSH, navigate to the directory containing your root Magento 2 folder and enter: tar -zcvf html.tar.gz /path/to/html –exclude=html/generated –exclude=html/media –exclude=html/pub –exclude=html/var