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

Commit 4dc9840

Browse files
authored
Merge pull request #6503 from vzabaznov/patch-5
Update private-content.md
2 parents 30a1a7b + 75405a6 commit 4dc9840

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/guides/v2.3/extension-dev-guide/cache/page-caching/private-content.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,26 @@ The following example adds comments to [app/code/Magento/Catalog/etc/frontend/se
100100
</config>
101101
```
102102
103+
There are sections that allow you to declare an 'action' node without specifying a sections, for instance, when logging out:
104+
105+
```xml
106+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
107+
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
108+
<action name="customer/account/logout"/>
109+
</config>
110+
```
111+
112+
This tells Magento to invalidate all sections. But if you have declared sections for this action in another .xml file, it will override the initial sections and only newly added sections will be invalidated. If you need to reload all sections on some action, use `*` as section name or use an empty action and ensure that they will not be overriden by any other rules:
113+
114+
```xml
115+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
116+
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
117+
<action name="customer/account/editPost">
118+
<section name="*"/>
119+
</action>
120+
</config>
121+
```
122+
103123
{:.bs-callout-warning}
104124
Use only HTTP POST or PUT methods to change state (e.g., adding to a shopping cart, adding to a wishlist, etc.) and do not expect to see caching on these methods. Using GET or HEAD methods might trigger caching and prevent updates to private content. For more information about caching, see [RFC-2616 section 13](https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html){:target="_blank"}.
105125

0 commit comments

Comments
 (0)