Log in
Platform
Solutions
Use cases
Log in

How to Enable & Disable Magento 2 Cache

In Magento 2, you will regularly use the Disable/Enable Cache Command Line. There are 12 default cache types for Magento 2. To manage Magento 2 cache on the command line, use one of five straightforward commands. We’ll walk you through each command line in detail in this blog.

To start off, let’s first understand what a Magento 2 cache is.

Why is Magento 2 cache important?

You can add as many things as you wish to sell online thanks to the demand of growing businesses and the backing of contemporary eCommerce technologies.

You have an excellent opportunity to take advantage of the market, but there are some usual hazards involved. For instance, a large number of products will negatively impact your website’s performance and its ability to convert visitors into paying customers. One of the best methods to provide your consumers speedy access to the information they need without making them wait for a page to load is through caching.

Magento 2’s Full Cache Page can assist you in resolving this problem. Once cached, your store will be updated and will perform quickly.

Simply put, a Magento 2 cache is a place where information or accessed data is kept. By the time you flush the cache, the content will have been updated and the site’s performance will have improved.

In Magento 2, go to System > Cache Management in the settings to view the Magento 2 cache management section. The file SYSTEM CACHING is by default turned on when you first install your Magento store. Using the command line, you may frequently enable or disable all cache types.

You can edit the env.php file in the app/etc folder to change it. The array_key value should be changed to either 1 or 0 in cache_types.

As a guide, the settings should look like this:

rtF PRiRJnU4g41H6IzQofgttApZAiNqWwhRtEglocO53aoVXjZfgWxpJWJGFuiwmzPx96

‘cache_types’ =>

    array (

        ‘config’ => 1,

        ‘layout’ => 1,

        ‘block_html’ => 1,

        ‘collections’ => 1,

        ‘db_ddl’ => 1,

        ‘eav’ => 1,

        ‘full_page’ => 0,

        ‘translate’ => 1,

        ‘config_integration’ => 1,

        ‘config_webservice’ => 1,

        ‘config_integration_api’ => 1,

    ),

);

How to Disable/Enable Magento 2 Cache

STEP 1: Open Cache Management

The only thing you have to do is log in to the Magento admin panel, go to SYSTEM > CACHE, and then click MANAGEMENT in the TOOLS tab.

qqaqjf0cIDtuMIY0NnuHZ87sE4dKNNIzeBsgMuD79b4n 1eX3kqNYoEfz8gq8JdqlgG1x2t5TGMlVLj9KjjAiBQMiV lUaolAZaw145xFpDd
u41sDuNceNMl3luAQ5Vj9anvFD4gP8TDXHtOM P93wWOrnfhEC2Ho6 Tp8he33PcKKm3UOsSoaJI2Vc QQKs525Ufzb6b8VLF8F3GSSmUrVmpP8zVK03IWwNs6PVASDhgpLSKWPM

STEP 2: Enable/Disable certain Magento 2 cache types

There is a table in the CACHE MANAGEMENT section. To enable or disable a certain Magento 2 cache type, click on the corresponding box. A drop-down menu will then appear in the top left corner of the screen. Select the desired action, then press the SUBMIT button next to it.

FFfCKyF1d4JVmC93YeBkVwLuFDKqnI avmsHzhy82TwzBcL0c

How to Enable/Disable a Magento 2 Cache Command Line

DISABLING A MAGENTO 2 CACHE COMMAND LINE

In order to disable all cache types, you can use the following command:

b YDFkGXaTtW0 SCvH4jyw7aTq06cvvXUI Nt76IjDhDpTDg3CYGoWO2bG7bsHxivGWcObmiJV6QJBObIy8sFWT0cnTKOIdpV77nfWj35

php bin/magento cache:disable

Similarly, you can enter this command line if you want to disable a certain type of Magento 2 cache:

php bin/magento cache:disable CACHE_TYPE

For example, you could use this:

d5LmFp8b RadA7XrlUWXKWx6rs1UfnvwnHmeBGO KTr6INJLj9gyTvkaAyRqZZmG 3uV RPSPohibW0ZXxpAr3HaTXhtA0hm6pVOWf6vOwXs 73cRcGf6871HMeRfVTd kPKlFLHI8GAT6P2NLMT5A

php bin/magento cache:disable config

ENABLING A MAGENTO 2 CACHE COMMAND LINE

The process is a lot similar to how you disable a single type of cache as well as all caches.

In order to enable all cache types, you can use the following command:

MVFLPDznDM3Sm V4T7hEHJXcHQ8dRcbZtM6KsBSlwYW5Ub972ErN0gljCPfiYEMqhKZLL4WP1gN X8Pz6lrDMcP En4jvb GoUobCESySXEkOR7HU 7YrwEzh8OV9ZuZ5uW82 VnswcYuofHhEuyQ

php bin/magento cache:enable

This is the code you would use in order to enable a specific type of cache:

gTb5kNHmDTfo G s8vxvR5d4tpiksvCBKLakK0IDvp19Yo9dzmnAUWzA5JifJ0

php bin/magento cache:enable CACHE_TYPE

You can use the following example as a reference:

vCyEO9yxer9eNWsQE6ROlletxs5uUTFV7PJReBKA0hAjYPFb 03 MyoN9 tqmP05UQ su1ZpH3oML7CBBD0jH4s1OJJdrPeFXZJlAQU7O

php bin/magento cache:enable layout

How to Check Magento 2 Cache Status

In order to see the Magento 2 cache status, you can enter the following command line:

qLofXD FCHZ aHhb2JIZSUWM5UZyqKZs5tnDPvOSVhbbHwYwsZhpavWDOol2HCnp ncXDalMd6CHBwVWwVhleq9Ao5Px

bin/magento cache:status

You should now be able to see a result that looks something like this:

ugAU5hqHQ1YYLZLuwBswVYTPM7iHs6 VAP M6VmNq3Jexrxbg1EFetClzJ9DkiIfJx8IPB56aKI8SkV2j8rqxye2xUDXoqPjqr bo8EDuD2R9eU6o bI052heatDKCCSuuyVGt T1QsSXG 2LlDMKw

How to Clear Magento 2 Cache Using Command line

The Magento 2 cache can be flushed and cleared using the commands below:

xxecUsB2X wmthCnwu68MixFjPUSSj09b26mfBaR0w1taDk a SOrp0ksFniQqrpWmvohqaUFjfvYnzi8NCmDmBWWjqNNEbmau7wiOt61JyRYV MXGBE63ysI5nfNrlvyo82H0BT8kbAycc9jYsMrQ

php bin/magento cache:clean

This command would help to flush all cache storage.

To flush the Magento 2 cache, you can use this command:

php bin/magento cache:flush

To sum it all off, In Magento 2, caching is essential. It’s time to monitor your cache management if you’re concerned about the performance of your store and the consumer experience.

We hope this article was helpful, and that you learned how to enable and disable Magento 2 cache. For more quick and easy step-by-step tutorials about Magento 2 and its functions, you can <click here> and push your company to whole new heights of success.

Get help from a human
Submit a request for help with your Braintree sandbox or production account.
Get Help
Select location and language

Contact Our Sales Team

Learn more about our products, features, and pricing options.
By submitting this form, you agree to receive promotional messages from Shopify about its products and services. You can unsubscribe at any time by clicking on the link at the bottom of our emails.
Product
Pricing
Use cases
Recourses
Documentation
Log in
Start a free trial