{"id":111974,"date":"2018-02-10T19:30:53","date_gmt":"2018-02-10T19:30:53","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=111974"},"modified":"2025-12-22T13:51:16","modified_gmt":"2025-12-22T13:51:16","slug":"sections-magento-2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/sections-magento-2\/","title":{"rendered":"Sections in Magento 2"},"content":{"rendered":"\n<p>Magento 2 has enhanced response time by implementing Sections, storing customer data in the browser&#8217;s local storage as key-value pairs.<\/p>\n\n\n\n<p>This post demonstrates creating custom sections within modules to utilize section data in template files.<\/p>\n\n\n\n<p>For this tutorial, I am using the <strong>Webkul_Section<\/strong> module. To create our custom section, we need to give an entry in the  <strong>etc\/frontend\/di.xml<\/strong> file.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:ObjectManager\/etc\/config.xsd&quot;&gt;\n    &lt;type name=&quot;Magento\\Customer\\CustomerData\\SectionPoolInterface&quot;&gt;\n        &lt;arguments&gt;\n            &lt;argument name=&quot;sectionSourceMap&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;customsection&quot; xsi:type=&quot;string&quot;&gt;Webkul\\Section\\CustomerData\\CustomSection&lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/arguments&gt;\n    &lt;\/type&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p>You can see we have given an item name=&#8221;<strong>customsection<\/strong>&#8221; and it defines its data source as&nbsp;Webkul\\Section\\CustomerData\\CustomSection.<\/p>\n\n\n\n<p>Now, we will create getSectionData() in Webkul\\Section\\CustomerData\\CustomSection.php file. This function is responsible for setting data in different sections.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\Section\\CustomerData;\nuse Magento\\Customer\\CustomerData\\SectionSourceInterface;\n\nclass CustomSection implements SectionSourceInterface\n{\n    \/**\n     * {@inheritdoc}\n     *\/\n    public function getSectionData()\n    {\n        return &#091;\n            &#039;msg&#039; =&gt;&#039;Data from section&#039;,\n        ];\n    }\n}<\/pre>\n\n\n\n<p>Now, to verify that everything is working fine so far, you can check the local storage of your browser. <\/p>\n\n\n\n<p>If you are using Chrome, then you can see it under the Application tab, as in the screenshot below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"546\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1-1200x546.webp\" alt=\"Magento section\" class=\"wp-image-422536\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1-1200x546.webp 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1-300x136.webp 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1-250x114.webp 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1-768x349.webp 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1.webp 1306w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Now, we will fetch the message that we set in our custom section. For this, we call our template file customsection.phtml on the product view page.<\/p>\n\n\n\n<p> For that, create a file catalog_product_view.xml following the path app\/code\/Webkul\/Section\/view\/frontend\/layout with the below code:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n\n&lt;page xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd&quot;&gt;\n    &lt;body&gt;\n        &lt;referenceContainer name=&quot;content&quot;&gt;\n            &lt;block class=&quot;Magento\\Framework\\View\\Element\\Template&quot;  name=&quot;custom_section&quot; template=&quot;Webkul_Section::customsection.phtml&quot;&gt;\n            &lt;\/block&gt;\n        &lt;\/referenceContainer&gt;\n    &lt;\/body&gt;\n&lt;\/page&gt;<\/pre>\n\n\n\n<p>Now create a template file with the name &#8220;customsection.phtml&#8221; following the path app\/code\/Webkul\/Section\/view\/frontend\/templates with the below code:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;div class=&quot;wk-customsection&quot;data-bind=&quot;scope: &#039;section&#039;&quot;&gt;\n    &lt;p data-bind=&quot;text: customsection().msg&quot;&gt;&lt;\/p&gt;\n&lt;\/div&gt;\n&lt;style&gt;\n.wk-customsection{\ndisplay: inline-block;\n}\n&lt;\/style&gt;\n&lt;script type=&quot;text\/x-magento-init&quot;&gt;\n    {\n        &quot;*&quot;: {\n            &quot;Magento_Ui\/js\/core\/app&quot;: {\n                &quot;components&quot;: {\n                    &quot;section&quot;: {\n                        &quot;component&quot;: &quot;Webkul_Section\/js\/section&quot;\n                    }\n                }\n            }\n        }\n    }\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>In the template file, you can see we have bound the div.wk-customsection with the component section.<\/p>\n\n\n\n<p>Note: The style tag used in the template file is only for modifying the CSS for custom section data.<br>You may either use\/remove it according to your requirements.<\/p>\n\n\n\n<p>Now, we will create the Webkul\/Section\/frontend\/web\/js\/section.js file.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">define(&#091;\n    &#039;uiComponent&#039;,\n    &#039;Magento_Customer\/js\/customer-data&#039;\n], function (Component, customerData) {\n    &#039;use strict&#039;;\n    \n    return Component.extend({\n        \/** @inheritdoc *\/\n        initialize: function () {\n            this._super();\n            this.customsection = customerData.get(&#039;customsection&#039;); \/\/pass your custom section name\n        }\n    });\n});<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1200\" height=\"604\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_379-1200x604.png\" alt=\"section product view\" class=\"wp-image-111977\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_379-1200x604.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_379-250x126.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_379-300x151.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_379-768x386.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_379.png 1272w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n<\/div>\n\n\n<p>After refreshing the cache, navigate to any product page and you will notice that the configured message is now displayed as expected, confirming that the section data is being loaded correctly.<\/p>\n\n\n\n<p><br>In the <code>section.js<\/code> file, we leverage <code>Magento_Customer\/js\/customer-data<\/code>.<\/p>\n\n\n\n<p>It plays a key role in Magento by managing the storage, retrieval, and automatic rendering of customer-related section data on the frontend without requiring full page reloads.<\/p>\n\n\n\n<p><br>This section&#8217;s data is dynamically refreshed whenever Magento processes AJAX requests using <strong>POST, PUT, or DELETE<\/strong> methods.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Advantages of using a section<\/h4>\n\n\n\n<p>When caching is enabled, the whole page content is cached, so this helps us to dynamically manage the components ofthe  page.<\/p>\n\n\n\n<p>For example, the complete page is cached.<\/p>\n\n\n\n<p>Now, when the customer logs in, only the components get updated with the value from the section, as you can see customer name, cart, and wish list are all managed by the section.<\/p>\n\n\n\n<p>All section data is fetched in 1 single Ajax call, hence the number of Ajax requests is reduced to a huge number.<\/p>\n\n\n\n<p>You can also manage when to update the section data by using etc\/frontend\/sections.xml<\/p>\n\n\n\n<p>If you require technical support, feel free to email us at&nbsp;<a href=\"mailto:support@webkul.com\">support@webkul.com<\/a><\/p>\n\n\n\n<p>Additionally, explore a wide array of solutions to boost your store\u2019s capabilities by visiting our&nbsp;<a href=\"https:\/\/store.webkul.com\/Magento-2.html\" target=\"_blank\" rel=\"noreferrer noopener\">Adobe Commerce modules section<\/a>&nbsp;and&nbsp;<a href=\"https:\/\/store.webkul.com\/Magento-2\/Marketplace-Addons.html\" target=\"_blank\" rel=\"noreferrer noopener\">Adobe Commerce marketplace addons<\/a>.<\/p>\n\n\n\n<p>Or looking to improve your store\u2019s speed and overall performance? Check out our&nbsp;<a href=\"https:\/\/webkul.com\/magento-speed-optimization-services\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 Speed &amp; Optimization services<\/a>.<\/p>\n\n\n\n<p>Get expert support and build&nbsp;<a href=\"https:\/\/webkul.com\/blog\/magento-customization\/\" target=\"_blank\" rel=\"noreferrer noopener\">customized solutions<\/a>&nbsp;by hiring skilled&nbsp;<a href=\"https:\/\/webkul.com\/hire-magento-developers\/\" target=\"_blank\" rel=\"noreferrer noopener\">Adobe Commerce developers<\/a>&nbsp;for your project.<\/p>\n\n\n\n<p>That&#8217;s all for this post. Happy Caching. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2 has enhanced response time by implementing Sections, storing customer data in the browser&#8217;s local storage as key-value pairs. This post demonstrates creating custom sections within modules to utilize section data in template files. For this tutorial, I am using the Webkul_Section module. To create our custom section, we need to give an entry <a href=\"https:\/\/webkul.com\/blog\/sections-magento-2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":116,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302],"tags":[3355,10063,2460,10062,6162,10061],"class_list":["post-111974","post","type-post","status-publish","format-standard","hentry","category-magento2","tag-caching","tag-fpc","tag-magento-2","tag-private-data","tag-section","tag-sections"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Sections in Magento 2 - Webkul Blog<\/title>\n<meta name=\"description\" content=\"sections in magento 2 for customer related data caching varnish cache\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/sections-magento-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sections in Magento 2 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"sections in magento 2 for customer related data caching varnish cache\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/sections-magento-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-10T19:30:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-22T13:51:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1-1200x546.webp\" \/>\n<meta name=\"author\" content=\"Ayaz Mittaqi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ayaz Mittaqi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/sections-magento-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/sections-magento-2\/\"},\"author\":{\"name\":\"Ayaz Mittaqi\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/3a9d84d349b963ed99f7aead9372dd6d\"},\"headline\":\"Sections in Magento 2\",\"datePublished\":\"2018-02-10T19:30:53+00:00\",\"dateModified\":\"2025-12-22T13:51:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/sections-magento-2\/\"},\"wordCount\":553,\"commentCount\":23,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/sections-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1-1200x546.webp\",\"keywords\":[\"caching\",\"fpc\",\"Magento 2\",\"private data\",\"section\",\"sections\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/sections-magento-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/sections-magento-2\/\",\"url\":\"https:\/\/webkul.com\/blog\/sections-magento-2\/\",\"name\":\"Sections in Magento 2 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/sections-magento-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/sections-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1-1200x546.webp\",\"datePublished\":\"2018-02-10T19:30:53+00:00\",\"dateModified\":\"2025-12-22T13:51:16+00:00\",\"description\":\"sections in magento 2 for customer related data caching varnish cache\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/sections-magento-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/sections-magento-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/sections-magento-2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1.webp\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1.webp\",\"width\":1306,\"height\":594,\"caption\":\"Magento section\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/sections-magento-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sections in Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/3a9d84d349b963ed99f7aead9372dd6d\",\"name\":\"Ayaz Mittaqi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9a683a7c995567db93858f0305606f73f9075f82330789701e3ed345f6f830aa?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9a683a7c995567db93858f0305606f73f9075f82330789701e3ed345f6f830aa?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Ayaz Mittaqi\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/ayaz-mittaqi024\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sections in Magento 2 - Webkul Blog","description":"sections in magento 2 for customer related data caching varnish cache","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/sections-magento-2\/","og_locale":"en_US","og_type":"article","og_title":"Sections in Magento 2 - Webkul Blog","og_description":"sections in magento 2 for customer related data caching varnish cache","og_url":"https:\/\/webkul.com\/blog\/sections-magento-2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2018-02-10T19:30:53+00:00","article_modified_time":"2025-12-22T13:51:16+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1-1200x546.webp","type":"","width":"","height":""}],"author":"Ayaz Mittaqi","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Ayaz Mittaqi","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/sections-magento-2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/sections-magento-2\/"},"author":{"name":"Ayaz Mittaqi","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/3a9d84d349b963ed99f7aead9372dd6d"},"headline":"Sections in Magento 2","datePublished":"2018-02-10T19:30:53+00:00","dateModified":"2025-12-22T13:51:16+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/sections-magento-2\/"},"wordCount":553,"commentCount":23,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/sections-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1-1200x546.webp","keywords":["caching","fpc","Magento 2","private data","section","sections"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/sections-magento-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/sections-magento-2\/","url":"https:\/\/webkul.com\/blog\/sections-magento-2\/","name":"Sections in Magento 2 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/sections-magento-2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/sections-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1-1200x546.webp","datePublished":"2018-02-10T19:30:53+00:00","dateModified":"2025-12-22T13:51:16+00:00","description":"sections in magento 2 for customer related data caching varnish cache","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/sections-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/sections-magento-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/sections-magento-2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1.webp","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/02\/Screenshot_378-1.webp","width":1306,"height":594,"caption":"Magento section"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/sections-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Sections in Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/3a9d84d349b963ed99f7aead9372dd6d","name":"Ayaz Mittaqi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9a683a7c995567db93858f0305606f73f9075f82330789701e3ed345f6f830aa?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9a683a7c995567db93858f0305606f73f9075f82330789701e3ed345f6f830aa?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Ayaz Mittaqi"},"url":"https:\/\/webkul.com\/blog\/author\/ayaz-mittaqi024\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/111974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/116"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=111974"}],"version-history":[{"count":13,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/111974\/revisions"}],"predecessor-version":[{"id":518432,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/111974\/revisions\/518432"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=111974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=111974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=111974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}