Magento模式设置

Magento有三种运行模式,按性能由低到高,依次为:developer < default < production

可以使用以下命令查看当前运行模式:

bin/magento deploy:mode:show

使用以下命令设置运行模式:

bin/magento deploy:mode:set developer  
bin/magento deploy:mode:set default   
bin/magento deploy:mode:set production

Magento默认使用的运行模式为default,为了更好的体验,建议切换到production模式。
如果你的项目里包含了很多主题,设置的语言包也有多个的话,那么在deploy的时候,可能会卡很久。那是因为切换到生产模式的时候,每个主题每个语言都要生成一套静态文件,粗略认为一套静态文件需要10秒,则总共需要的时间为m*n*10

解决方法有两种:第一种删除不要的语言包;第二种把注册文件registration.php改成registration.php.bak

生产模式下,如果修改了代码,一般需要以下几个步骤:

# 启用维护模式
magento maintenance:enable
# 编译
bin/magento setup:di:compile
# 部署静态文件
bin/magento setup:static-content:deploy
# 清缓存
bin/magento cache:flush
# 停用维护模式
magento maintenance:disable
上一篇 Magento版本查看
下一篇 Python数组遍历
目录
文章列表
1 Glide错误IllegalArgumentException You cannot start a load for a destroyed activity
Glide错误IllegalArgumentException You cannot start a load for a destroyed activity
2
Jenkins构建任务注意事项
Jenkins构建任务注意事项
3
Makefile反过滤函数filter-out
Makefile反过滤函数filter-out
4
设计模式(5)工厂方法模式
设计模式(5)工厂方法模式
5
Spring Boot时间格式的时区转换
Spring Boot时间格式的时区转换
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。