The customer-data JS library provides the ability to store private data in local storage most efficiently. However, there is a better way to treat private content. This approach allows you to reload a part of a web page without reloading its entire content and breaking the whole Magento 2 page cache. The system monitors section changes and loads updated data automatically. Next, it caches loaded data in local storage in a browser via the following key: mage-cache-storage. Magento uses AJAX requests to /customer/section/load/ to load sections. A grouped piece of customer information (private data) forms a section, each of which is represented by the key utilized for accessing and managing the data itself. Magento 2 handles private content on the client-side (e.g., web browser) because it is specific to individual users. It may be any customer data, like payment information, selected product options, private deals, checkout information, etc. After that, the system updates public information.Īs you can see, private content is flexible but not sharable data with a short life span. The life span of public content from the perspective of caching lasts about a day. However, an individual touch may be added when a customer selects options for a configurable product. They mainly provide public product information and static web content which stays the same across all store visitors. When it comes to product and catalog pages, things may be a little bit more complicated. About Us, Contact Info, or even blog posts remain the same for all users. The most evident example of public content is CMS pages. The former type is static data with a long life span. Magento 2 relies on two content types: public and private. 3 Magento 2 private content block performance optimization.2 Magento 2 private content block performance issue.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |