Magento缓存操作命令

7天成为Magento系统架构师,现在开始学习Magento全栈开发!

《Magento2.X企业级开发实战》

后台缓存操作

后台菜单 system > tools > Cache Management 可以直接管理magento的缓存

查看Magento的缓存状态

$ bin/magento cache:status
Current status:
                        config: 1
                        layout: 1
                    block_html: 1
                   collections: 1
                    reflection: 1
                        db_ddl: 1
               compiled_config: 1
                           eav: 1
         customer_notification: 1
            config_integration: 1
        config_integration_api: 1
                     full_page: 1
             config_webservice: 1
                     translate: 1
                        vertex: 1

上面列出了当前magento系统里全部的缓存类型和对应的状态, 0关闭/1开启

开启Magento缓存

bin/magento cache:enable [type] … [type] #多个type用空格分开

例如:

$ bin/magento cache:enable config
Changed cache status:
                        config: 0 -> 1
Cleaned cache types:
config

关闭Magento缓存

bin/magento cache:disable [type] … [type] #多个type用空格分开

例如:

$ bin/magento cache:disable config
Changed cache status:
                        config: 1 -> 0

清空缓存命令

清空指定缓存

bin/magento cache:clean [type] ... [type]
bin/magento cache:flush [type] ... [type]

清空全部缓存

bin/magento cache:flush

参考链接: https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-cache.html#config-cli-subcommands-cache-clean-over

文章来源于互联网:Magento缓存操作命令

如无特殊说明或标注,任何个人或组织,复制、转载、采集本站内容请注明:
本文来源于:【Magento中文网】,并添加本文地址链接。
如未按上述操作复制或转载,本站有权追究法律责任。
若本站内容侵犯了原著者的合法权益,可联系我们进行处理。