easy tricks to clear cache? [closed]
-
30-12-2020 - |
سؤال
please share your idea to handle magento2 cache with sublime IDE.
المحلول
I have some trick to manage cache for magento2 developer.
We have multiple commands for manage caches.
php bin/magento cache:disable
php bin/magento cache:enable
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento s:s:d -f
or delete folder of cache using command
rm -rf '/var/www/html/magento_first_demo/var' && rm -rf '/var/www/html/magento_first_demo/generated
For sublime user can make shortcut for clear cache
Goto Preferences > Key Bindings and add this text and save file.
[
{ "keys": ["ctrl+alt+d"], "command": "exec", "args": { "shell_cmd": "php /var/www/html/magento_first_demo/bin/magento c:f" } },
{ "keys": ["ctrl+alt+c"], "command": "exec", "args": { "shell_cmd": "php /var/www/html/magento_first_demo/bin/magento setup:upgrade && php bin/magento s:s:d -f" } },
{ "keys": ["ctrl+alt+s"], "command": "exec", "args": { "shell_cmd": "rm -rf '/var/www/html/magento_first_demo/var' && rm -r '/var/www/html/magento_first_demo/generated'" } }
]
Than save file using ctrl+s
Now you have a shortcuts to handle cache
ctrl+alt+d -> cd /var/www/html/magento_first_demo && php bin/magento cache:flush
ctrl+alt+c -> cd /var/www/html/magento_first_demo && php bin/magento setup:upgrade && php bin/magento setup:static-content:deploy -f
ctrl+alt+s -> rm -rf '/var/www/html/magento_first_demo/var' && rm -r '/var/www/html/magento_first_demo/generated
Notes : You have to modify above code as per your project folder and your OS commands.
لا تنتمي إلى magento.stackexchange