Magento 2中文文档教程
来源:互联网 发布:端口镜像是做什么用的 编辑:程序博客网 时间:2024/06/06 02:46
缓存类型概述
Configuration
config
Magento2收集配置所有的模块,将它合并,节省了合并结果的缓存。该缓存还包含存储在文件系统和数据库中的特定存储设置。
修改配置文件后,清除或刷新此缓存类型.
Layout
layout
已编译的页面布局(即所有组件的布局组件)。
修改布局文件后,清除或刷新此缓存类型.
Block HTML output
block_html
HTML 页面或者 block.
修改视图层后,清除或刷新缓存类型。
Collections data
collections
数据库查询结果.
DDL
db_ddl
数据库 schema.
自动更新数据库模式的一种方法是使用 magento setup:db-schema:upgrade 命令.
Entity attribute value (EAV)
eav
以EAV属性相关的元数据(例如,存储标签,链接到相关的PHP代码,属性渲染,搜索设置,等等)。
Page cache
full_page
生成的HTML页面.
Reflection
reflection
删除的WebAPI模块和客户模块之间的依赖关系。Translations
translate
从所有模块合并翻译.
Integration configuration
config_integration
编译的集成。
更改或添加Integration后清除或刷新此缓存。
Integration API configuration
config_integration_api
编译集成的API.
Web services configuration
config_webservice
Web API 结构.
第一步
登录到Magento服务器切换到Magento 2文件系统的所有者用户要有写入的权限.
如果你使用bash shell,你也可以使用下面的语法转换到Magento文件系统所有者:
su <Magento 2文件系统所有者> -s /bin/bash -c <command> sudo -u <Magento 2文件系统所有者> <command>
您也可以按下列方式运行命令:
cd <Magento 2 安装目录>/bin
并运行它们./magento <command name>
php <Magento 2 安装目录>/bin/magento <command name>
除了这里讨论的命令参数外,请参见常见参数.
查看缓存状态
要查看缓存的状态,请输入
magento cache:status
一个示例如下:
config: 1 layout: 1 block_html: 1 collections: 1 db_ddl: 1 eav: 1 full_page: 1 translate: 1 config_integration: 1 config_integration_api: 1 config_webservice: 1
启用或禁用缓存类型
此命令使您能够启用或禁用所有缓存类型或仅指定的缓存类型。禁用缓存类型是有用在开发中,无需刷新缓存就可以查看改变;然而,禁用缓存类型对性能有负面影响。
命令选项:
magento cache:enable [type] ... [type]magento cache:disable [type] ... [type]
启用缓存类型自动清除缓存类型。
清理和刷新缓存类型
若要清除缓存中的过期项目,您可以使用 clean 或 flush 缓存类型:
命令的用法:
magento cache:clean [type] ... [type]magento cache:flush [type] ... [type]
例如,要刷新所有缓存类型,请输入
magento cache:flush
示例结果:
Flushed cache types:configlayoutblock_htmlcollectionsdb_ddleavfull_pagetranslateconfig_integrationconfig_integration_apiconfig_webservice
你也可以在magento 2 后台管理缓存. System > Tools > Cache Management.Flush Cache Storage .
- Magento 2中文文档教程
- Magento 2中文文档教程
- Magento 2中文文档教程
- Magento 2中文文档教程
- Magento 2中文文档教程
- Magento 2中文手册教程
- Magento 2中文手册教程
- Magento 2中文手册教程
- Magento 2中文手册教程
- Magento 2中文手册教程
- Magento 2中文手册教程
- Magento 2中文手册教程
- Magento 2中文手册教程
- Magento 2中文手册教程
- Magento 2中文手册教程
- Magento 2中文手册教程
- Magento 2中文手册教程
- Magento-中文开发教程
- 深度学习之图像标注工具【python版】
- QT mysql语句中使用变量的方法
- hdoj1034 Candy Sharing Game(简单题)
- TCP/UDP/HTTP
- struts零散知识累积(一)
- Magento 2中文文档教程
- C#方法重载(overload)、重写(覆盖)(override)、隐藏(new) -第四天
- USACO之Section1.1.3 Friday the Thirteenth
- 数据库迁移之从oracle 到 MySQL
- [Leetcode] 157. Read N Characters Given Read4 解题报告
- openssl 错误处理
- 一些有趣的算法题收集-Category
- UESTC 1639 云中谁寄锦书来?雁字回时,月满西楼。 Dijkstra拓展
- Shell中的字符串处理