1

In my Magento 2, I can't enable/disable cache In System -> Cache Management, the two options are missing from the dropdown menu. what went wrong?

It's in Production mode.

enter image description here

I can only enable / disable cache via CLI.

  • 1
    Magento Does not allow you to enable or disable cache types in Admin when production mode is enabled. – Emipro Technologies Pvt. Ltd. Apr 17 '18 at 13:17
4

It looks like it is meant to be like this in Magento 2.2 when production mode enabled

production mode

Intended for deployment on a production system, this mode:

Does not show exceptions to the user (exceptions are written to logs only).

Serves static view files from cache only. Prevents automatic code file compilation.

New or updated files are not written to the file system.

Does not allow you to enable or disable cache types in Magento Admin.

http://devdocs.magento.com/guides/v2.2/config-guide/bootstrap/magento-modes.html#mode-production

|improve this answer|||||
1

Magento is happy for you to enable/disable the cache using the commandline while in production mode:

[user@host ~/public_html]$  php bin/magento cache:enable

or

[user@host ~/public_html]$  php bin/magento cache:disable

IMO its silly not to be able to switch the cache on/off in Magento admin while running in production mode. Its handy for troubleshooting and switching from production to developer mode is way overkill to simply enable/ disable cache as it causes downtime during the switch and drastically reduced performance. It would be a much better idea to simply warn magento users if any part of the cache is disabled with a notification than to completely remove all actions from the cache management screen.

Just my two satoshis.

|improve this answer|||||
0
I have fixed by disabling Production Mode by going

app/etc/env.php

Replace this with

'x-frame-options' => 'SAMEORIGIN',
'MAGE_MODE' => 'production',
'session' => [
    'save' => 'files'
],

with

  'x-frame-options' => 'SAMEORIGIN',
    'MAGE_MODE' => 'default',
    'session' => [
        'save' => 'files'
    ],
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.