1

What are the cache directories of Magento 2.

Just I need to remove those my rm -rf command without executing Magento cache:flush command.

3

Either u can manually delete folders or using this command

rm -rf var/cache/ generated/code pub/static/frontend pub/static/adminhtml

After that you need to run these commands again , else the css/styles in magento frot-end and back-end won't load

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento setup:di:compile
sudo chmod -R 777 var/ pub/ generated/
| improve this answer | |
  • After remove folder, need to run setup:upgrade! why ? – Pawan Feb 28 at 4:15
1

So Are you want to remove cache files ? If yes than remove these folders:

/var/cache

/var/page_cache

Simply remove this folders.

| improve this answer | |
1

You need to remove these directories

<magento_root>/var/cache/* 
<magento_root>/var/page_cache/* 
<magento_root>/generated/metadata/* 
<magento_root>/generated/code/*

for more information please follow this link: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/cache/partial-caching/database-caching.html

| 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.