Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit f1e3479

Browse files
author
Lori Krell
authored
Merge pull request #2515 from magento/2.3-cache-type
Override page with 2.3 new cache type
2 parents cbe839a + 2c28c54 commit f1e3479

File tree

1 file changed

+220
-1
lines changed

1 file changed

+220
-1
lines changed
Lines changed: 220 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,220 @@
1-
../../../v2.2/config-guide/cli/config-cli-subcommands-cache.md
1+
---
2+
group: config-guide
3+
subgroup: 04_CLI
4+
title: Manage the cache
5+
menu_title: Manage the cache
6+
menu_node:
7+
menu_order: 50
8+
version: 2.3
9+
github_link: config-guide/cli/config-cli-subcommands-cache.md
10+
functional_areas:
11+
- Configuration
12+
- System
13+
- Setup
14+
---
15+
16+
{% include config/cli-intro.md %}
17+
18+
## Overview of cache types {#config-cli-subcommands-cache-clean-over}
19+
Magento 2 has the following {% glossarytooltip 0bc9c8bc-de1a-4a06-9c99-a89a29c30645 %}cache{% endglossarytooltip %} types:
20+
21+
<table>
22+
<tbody>
23+
<tr>
24+
<th>Cache type "friendly" name</th>
25+
<th>Cache type code name</th>
26+
<th>Description</th>
27+
</tr>
28+
<tr>
29+
<td><p>Configuration</p></td>
30+
<td><p>config</p></td>
31+
<td><p>Magento collects configuration from all modules, merges it, and saves the merged result to the cache. This cache also contains store-specific settings stored in the file system and database. </p>
32+
<p>Clean or flush this cache type after modifying configuration files.</p></td>
33+
</tr>
34+
<tr>
35+
<td><p>Layout</p></td>
36+
<td><p>layout</p></td>
37+
<td><p>Compiled page layouts (that is, the layout components from all components).</p>
38+
<p>Clean or flush this cache type after modifying layout files.</p></td>
39+
</tr>
40+
<tr>
41+
<td><p>Block HTML output</p></td>
42+
<td><p>block_html</p></td>
43+
<td><p>HTML page fragments per block.</p>
44+
<p>Clean or flush this cache type after modifying the view layer.</p></td>
45+
</tr>
46+
<tr>
47+
<td><p>Collections data</p></td>
48+
<td><p>collections</p></td>
49+
<td><p>Results of database queries.</p>
50+
<p>If necessary, Magento cleans up this cache automatically, but third-party developers can put any data in any segment of the cache. </p>
51+
<p>Clean or flush this cache type if your custom module uses logic that results in cache entries that Magento cannot clean.</p></td>
52+
</tr>
53+
<tr>
54+
<td><p>DDL</p></td>
55+
<td><p>db_ddl</p></td>
56+
<td><p>Database schema. </p>
57+
<p>If necessary, Magento cleans up this cache automatically, but third-party developers can put any data in any segment of the cache. </p>
58+
<p>Clean or flush this cache type after you make custom changes to the database schema. (In other words, updates that Magento does not make itself.)</p>
59+
<p>One way to update the database schema automatically is using the <a href="{{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-db.html">magento setup:db-schema:upgrade</a> command.</p></td>
60+
</tr>
61+
<tr>
62+
<td><p>Compiled Config</p></td>
63+
<td><p> compiled_config </p></td>
64+
<td><p>Compilation configuration</p></td>
65+
</tr>
66+
<tr>
67+
<td><p>Entity attribute value (EAV)</p></td>
68+
<td><p>eav</p></td>
69+
<td><p>Metadata related to EAV attributes (for example, store labels, links to related PHP code, attribute rendering, search settings, and so on).</p>
70+
<p>You should not typically need to clean or flush this cache type.</p></td>
71+
</tr>
72+
<tr>
73+
<td><p>Page cache</p></td>
74+
<td><p>full_page</p></td>
75+
<td><p>Generated HTML pages. </p>
76+
<p>If necessary, Magento cleans up this cache automatically, but third-party developers can put any data in any segment of the cache. </p>
77+
<p>Clean or flush this cache type after modifying code level that affects HTML output. It’s recommended to keep this cache enabled because caching HTML improves performance significantly.</p></td>
78+
</tr>
79+
<tr>
80+
<td><p>Reflection</p></td>
81+
<td><p>reflection</p></td>
82+
<td>Removes a dependency between the Webapi module and the Customer module.</td>
83+
</tr>
84+
<tr>
85+
<td><p>Translations</p></td>
86+
<td><p>translate</p></td>
87+
<td><p>Merged translations from all modules.</p></td>
88+
</tr>
89+
<tr>
90+
<td><p>Integration configuration</p></td>
91+
<td><p>config_integration</p></td>
92+
<td><p>Compiled integrations.</p>
93+
<p>Clean or flush this cache after changing or adding integrations.</p></td>
94+
</tr>
95+
<tr>
96+
<td><p>Integration API configuration</p></td>
97+
<td><p>config_integration_api</p></td>
98+
<td><p>Compiled integration APIs.</p></td>
99+
</tr>
100+
<tr>
101+
<td><p>Web services configuration</p></td>
102+
<td><p>config_webservice</p></td>
103+
<td><p>Web API structure.</p></td>
104+
</tr>
105+
106+
</tbody>
107+
</table>
108+
109+
## View the cache status
110+
To view the status of the cache, enter
111+
112+
bin/magento cache:status
113+
114+
<!-- where `--bootstrap=` is a URL-encoded associative array of Magento <a href="{{ page.baseurl }}/config-guide/bootstrap/magento-how-to-set.html#config-bootparam-overview">application bootstrap parameters</a> and values. -->
115+
116+
A sample follows:
117+
118+
config: 1
119+
layout: 1
120+
block_html: 1
121+
collections: 1
122+
db_ddl: 1
123+
compiled_config: 1
124+
eav: 1
125+
full_page: 1
126+
translate: 1
127+
config_integration: 1
128+
config_integration_api: 1
129+
config_webservice: 1
130+
131+
## Enable or disable cache types {#config-cli-subcommands-cache-en}
132+
This command enables you to enable or disable all cache types or only the ones you specify. Disabling cache types is useful during development because you see the results of your changes without having to flush the cache; however, disabling cache types has an adverse effect on performance.
133+
134+
<div class="bs-callout bs-callout-info" id="info" markdown="1">
135+
Starting in version 2.2, you can enable or disable cache types _only_ using the command line. Before doing so, you must manually make `<your Magento install dir>/app/etc/env.php` writeable by the [Magento file system owner]({{ page.baseurl }}/install-gde/prereq/file-system-perms.html).
136+
137+
You can clean (also referred to as _flush_ or _refresh_) cache types using either the command line or the {% glossarytooltip 18b930cf-09cc-47c9-a5e5-905f86c43f81 %}Magento Admin{% endglossarytooltip %}.
138+
</div>
139+
140+
Command options:
141+
142+
bin/magento cache:enable [type] ... [type]
143+
bin/magento cache:disable [type] ... [type]
144+
145+
Where omitting `[type]` enables or disables all cache types at the same time. The `type` option is a space-separated list of cache types.
146+
147+
<!-- `--bootstrap=` is a URL-encoded associative array of Magento <a href="{{ page.baseurl }}/config-guide/bootstrap/magento-how-to-set.html#config-bootparam-overview">application bootstrap parameters</a> and values. -->
148+
149+
To list cache types and their status:
150+
151+
bin/magento cache:status
152+
153+
For example, to disable the full page cache and the DDL cache:
154+
155+
bin/magento cache:disable db_ddl full_page
156+
157+
Sample result:
158+
159+
Changed cache status:
160+
db_ddl: 1 -> 0
161+
full_page: 1 -> 0
162+
163+
<div class="bs-callout bs-callout-info" id="info" markdown="1">
164+
Enabling a {% glossarytooltip 65f9a5a1-79ee-4f27-aac7-29abe24db40d %}cache type{% endglossarytooltip %} automatically clears that cache type.
165+
</div>
166+
167+
## Clean and flush cache types {#config-cli-subcommands-cache-clean}
168+
To purge out-of-date items from the cache, you can *clean* or *flush* cache types:
169+
170+
- Cleaning a cache type deletes all items from enabled Magento cache types only. In other words, this option does not affect other processes or applications because it cleans only the cache that Magento uses.
171+
172+
Disabled cache types are not cleaned.
173+
174+
- Flushing a cache type purges the cache storage, which might affect other processes applications that are using the same storage.
175+
176+
Flush cache types if you've already tried cleaning the cache and you're still having issues that you cannot isolate.
177+
178+
Command usage:
179+
180+
bin/magento cache:clean [type] ... [type]
181+
bin/magento cache:flush [type] ... [type]
182+
183+
Where `[type]` is a space-separated list of cache types. Omitting `[type]` cleans or flushes all cache types at the same time. For example, to flush all cache types, enter
184+
185+
bin/magento cache:flush
186+
187+
Sample result:
188+
189+
Flushed cache types:
190+
config
191+
layout
192+
block_html
193+
collections
194+
db_ddl
195+
compiled_config
196+
eav
197+
full_page
198+
translate
199+
config_integration
200+
config_integration_api
201+
config_webservice
202+
203+
<div class="bs-callout bs-callout-info" id="info" markdown="1">
204+
You can also clean and flush cache types in the {% glossarytooltip 18b930cf-09cc-47c9-a5e5-905f86c43f81 %}Magento Admin{% endglossarytooltip %}. Go to **System** > **Tools** > **Cache Management**. **Flush Cache Storage** is equivalent to `bin/magento cache:flush`. **Flush Magento Cache** is equivalent to `bin/magento cache:clean`.
205+
</div>
206+
207+
#### Related topics
208+
209+
- <a href="{{ page.baseurl }}/config-guide/cli/config-cli-subcommands-index.html">Manage the indexers</a>
210+
- <a href="{{ page.baseurl }}/config-guide/cli/config-cli-subcommands-cron.html">Configure and run cron</a>
211+
- <a href="{{ page.baseurl }}/config-guide/cli/config-cli-subcommands-compiler.html">Code compiler</a>
212+
- <a href="{{ page.baseurl }}/config-guide/cli/config-cli-subcommands-mode.html">Set the Magento mode</a>
213+
- <a href="{{ page.baseurl }}/config-guide/cli/config-cli-subcommands-urn.html">URN highlighter</a>
214+
- <a href="{{ page.baseurl }}/config-guide/cli/config-cli-subcommands-depen.html">Dependency reports</a>
215+
- <a href="{{ page.baseurl }}/config-guide/cli/config-cli-subcommands-i18n.html">Translation dictionaries and language packages</a>
216+
- <a href="{{ page.baseurl }}/config-guide/cli/config-cli-subcommands-static-view.html">Deploy static view files</a>
217+
- <a href="{{ page.baseurl }}/config-guide/cli/config-cli-subcommands-less-sass.html">Create symlinks to LESS files</a>
218+
- <a href="{{ page.baseurl }}/config-guide/cli/config-cli-subcommands-test.html">Run unit tests</a>
219+
- <a href="{{ page.baseurl }}/config-guide/cli/config-cli-subcommands-layout-xml.html">Convert layout XML files</a>
220+
- <a href="{{ page.baseurl }}/config-guide/cli/config-cli-subcommands-perf-data.html">Generate data for performance testing</a>

0 commit comments

Comments
 (0)