{"id":10167,"date":"2025-05-05T16:03:53","date_gmt":"2025-05-05T16:03:53","guid":{"rendered":"https:\/\/www.magetop.com\/blog\/?p=10167"},"modified":"2025-05-05T16:03:56","modified_gmt":"2025-05-05T16:03:56","slug":"how-to-configure-varnish-cache-in-magento-2","status":"publish","type":"post","link":"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/","title":{"rendered":"How To Configure Varnish Cache In Magento 2"},"content":{"rendered":"\n<p>Varnish Cache is a powerful HTTP accelerator that significantly boosts Magento 2 performance by caching full-page responses. In this guide, you\u2019ll learn <strong>How To Configure Varnish Cache In Magento 2<\/strong> and connect it to your web server setup.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps To Configure Varnish Cache In Magento 2<\/h2>\n\n\n\n<p><strong>Step 1: Enable Varnish in Magento 2<\/strong><\/p>\n\n\n\n<p>1. In the Magento Admin Panel, go to <strong>Stores &gt; Configuration &gt; Advanced &gt; System<\/strong><\/p>\n\n\n\n<p>2. Under the <strong>Full Page Cache<\/strong> section:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"216\" data-attachment-id=\"10169\" data-permalink=\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/screenshot\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot.png?fit=1359%2C366&amp;ssl=1\" data-orig-size=\"1359,366\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot.png?fit=300%2C81&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot.png?fit=800%2C216&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot.png?resize=800%2C216&#038;ssl=1\" alt=\"\" class=\"wp-image-10169\" srcset=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot.png?resize=1024%2C276&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot.png?resize=300%2C81&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot.png?resize=768%2C207&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot.png?w=1359&amp;ssl=1 1359w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set <strong>Caching Application<\/strong> to <strong>Varnish Cache<\/strong><\/li>\n\n\n\n<li>Set <strong>TTL for public content<\/strong> (e.g., <code>86400<\/code> seconds)<\/li>\n<\/ul>\n\n\n\n<p>Click <strong>Save Config<\/strong><\/p>\n\n\n\n<p><strong>Step 2: Export Magento\u2019s Varnish Configuration<\/strong><\/p>\n\n\n\n<p>1. Still in the <strong>Full Page Cache<\/strong> section, locate the <strong>Varnish Configuration<\/strong> subsection.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"316\" data-attachment-id=\"10170\" data-permalink=\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/screenshot_1-14\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot_1-1.png?fit=1341%2C531&amp;ssl=1\" data-orig-size=\"1341,531\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot_1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot_1-1.png?fit=300%2C119&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot_1-1.png?fit=800%2C316&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot_1-1.png?resize=800%2C316&#038;ssl=1\" alt=\"\" class=\"wp-image-10170\" srcset=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot_1-1.png?resize=1024%2C405&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot_1-1.png?resize=300%2C119&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot_1-1.png?resize=768%2C304&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot_1-1.png?w=1341&amp;ssl=1 1341w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>Configure the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Access List<\/strong> (e.g., <code>localhost<\/code>)<\/li>\n\n\n\n<li><strong>Backend Host<\/strong>: <code>127.0.0.1<\/code><\/li>\n\n\n\n<li><strong>Backend Port<\/strong>: <code>8080<\/code> (assuming your web server listens on this port)<\/li>\n<\/ul>\n\n\n\n<p>Click <strong>Export VCL for Varnish 6<\/strong><\/p>\n\n\n\n<p>Magento will download a <code>varnish.vcl<\/code> file customized for your current store settings.<\/p>\n\n\n\n<p><strong>Step 3: Replace the Default Varnish Configuration<\/strong><\/p>\n\n\n\n<p>Upload the exported <code>.vcl<\/code> file to your server and replace the default configuration:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo mv \/path\/to\/varnish.vcl \/etc\/varnish\/default.vcl\n<\/pre><\/div>\n\n\n<p>Restart Varnish to apply the changes:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo systemctl restart varnish\n<\/pre><\/div>\n\n\n<p><strong>Step 4: Verify Varnish Is Working with Magento<\/strong><\/p>\n\n\n\n<p>Use <code>curl<\/code> to inspect the response headers:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncurl -I http:\/\/yourdomain.com\n<\/pre><\/div>\n\n\n<p>Look for a header like:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nVia: 1.1 varnish\n<\/pre><\/div>\n\n\n<p>You can also enable developer hints or log headers to confirm cache hits\/misses.<\/p>\n\n\n\n<p><strong>Bonus Tip: Handling HTTPS<\/strong><\/p>\n\n\n\n<p>Varnish does not support HTTPS directly. For SSL termination:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use <strong>Nginx<\/strong> or <strong>Apache<\/strong> on port <code>443<\/code><\/li>\n\n\n\n<li>Set them to forward HTTP requests to Varnish on port <code>80<\/code><\/li>\n<\/ul>\n\n\n\n<p>This setup ensures secure access for customers while still benefiting from Varnish caching.<\/p>\n\n\n\n<p>Integrating Magento 2 with Varnish Cache is a straightforward process once Varnish is installed. By exporting Magento\u2019s VCL and linking it properly, you\u2019ll significantly boost performance, reduce load times, and create a smoother shopping experience for your users.<\/p>\n\n\n\n<p>Follow us for the more helpful posts!<\/p>\n\n\n\n<p>We hope this is a useful post for you.<\/p>\n\n\n\n<p>You can read more useful posts like<strong> <a href=\"https:\/\/www.magetop.com\/blog\/how-to-install-varnish-cache-on-ubuntu\/\">How To Install Varnish Cache on Ubuntu<\/a><\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Varnish Cache is a powerful HTTP accelerator that significantly boosts Magento 2 performance by caching full-page responses. In this guide,<\/p>\n","protected":false},"author":106,"featured_media":10173,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[2303,2304,2305,2298],"class_list":["post-10167","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento-2-tutorials","tag-configure-varnish-cache","tag-configure-varnish-cache-in-magento-2","tag-how-to-configure-varnish-cache-in-magento-2","tag-varnish-cache"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Configure Varnish Cache In Magento 2 - Magetop Blog<\/title>\n<meta name=\"description\" content=\"Varnish Cache is a powerful HTTP accelerator that significantly boosts Magento 2 performance by caching full-page responses. In this guide, you\u2019ll learn How To Configure Varnish Cache In Magento 2 and connect it to your web server setup.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Configure Varnish Cache In Magento 2 - Magetop Blog\" \/>\n<meta property=\"og:description\" content=\"Varnish Cache is a powerful HTTP accelerator that significantly boosts Magento 2 performance by caching full-page responses. In this guide, you\u2019ll learn How To Configure Varnish Cache In Magento 2 and connect it to your web server setup.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Magetop Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/MagetopStore\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-05T16:03:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-05T16:03:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Configure-Varnish-Cache-In-Magento-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1355\" \/>\n\t<meta property=\"og:image:height\" content=\"753\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Aaron LX\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@MagetopStore\" \/>\n<meta name=\"twitter:site\" content=\"@MagetopStore\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Aaron LX\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/\"},\"author\":{\"name\":\"Aaron LX\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/b8770690a02cc53a273d6b7205229ff7\"},\"headline\":\"How To Configure Varnish Cache In Magento 2\",\"datePublished\":\"2025-05-05T16:03:53+00:00\",\"dateModified\":\"2025-05-05T16:03:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/\"},\"wordCount\":313,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Configure-Varnish-Cache-In-Magento-2.png?fit=1355%2C753&ssl=1\",\"keywords\":[\"Configure Varnish Cache\",\"Configure Varnish Cache In Magento 2\",\"How To Configure Varnish Cache In Magento 2\",\"Varnish Cache\"],\"articleSection\":[\"Magento 2 Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/\",\"url\":\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/\",\"name\":\"How To Configure Varnish Cache In Magento 2 - Magetop Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Configure-Varnish-Cache-In-Magento-2.png?fit=1355%2C753&ssl=1\",\"datePublished\":\"2025-05-05T16:03:53+00:00\",\"dateModified\":\"2025-05-05T16:03:56+00:00\",\"description\":\"Varnish Cache is a powerful HTTP accelerator that significantly boosts Magento 2 performance by caching full-page responses. In this guide, you\u2019ll learn How To Configure Varnish Cache In Magento 2 and connect it to your web server setup.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Configure-Varnish-Cache-In-Magento-2.png?fit=1355%2C753&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Configure-Varnish-Cache-In-Magento-2.png?fit=1355%2C753&ssl=1\",\"width\":1355,\"height\":753,\"caption\":\"How To Configure Varnish Cache In Magento 2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.magetop.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Configure Varnish Cache In Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#website\",\"url\":\"https:\/\/www.magetop.com\/blog\/\",\"name\":\"Magetop Blog\",\"description\":\"Exploring Magento Tips, Tricks, and Trends\",\"publisher\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.magetop.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\",\"name\":\"Magetop.com\",\"url\":\"https:\/\/www.magetop.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1\",\"width\":475,\"height\":475,\"caption\":\"Magetop.com\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/MagetopStore\",\"https:\/\/x.com\/MagetopStore\",\"https:\/\/www.linkedin.com\/company\/magetop\",\"https:\/\/www.pinterest.com\/magetop\",\"https:\/\/www.youtube.com\/channel\/UCXoiJsz88OfPmwa8QpUkwOA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/b8770690a02cc53a273d6b7205229ff7\",\"name\":\"Aaron LX\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/11\/475315059_122137709240563546_260104055231757176_n.jpg?fit=96%2C96&#038;ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/11\/475315059_122137709240563546_260104055231757176_n.jpg?fit=96%2C96&#038;ssl=1\",\"caption\":\"Aaron LX\"},\"description\":\"Aaron is a passionate writer, crazy about shopping, eCommerce and trends. Besides his outstanding research skills and a positive mind, Aaron eagerly shares his experience with the readers.\",\"url\":\"https:\/\/www.magetop.com\/blog\/author\/aaron-lx\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Configure Varnish Cache In Magento 2 - Magetop Blog","description":"Varnish Cache is a powerful HTTP accelerator that significantly boosts Magento 2 performance by caching full-page responses. In this guide, you\u2019ll learn How To Configure Varnish Cache In Magento 2 and connect it to your web server setup.","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:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/","og_locale":"en_US","og_type":"article","og_title":"How To Configure Varnish Cache In Magento 2 - Magetop Blog","og_description":"Varnish Cache is a powerful HTTP accelerator that significantly boosts Magento 2 performance by caching full-page responses. In this guide, you\u2019ll learn How To Configure Varnish Cache In Magento 2 and connect it to your web server setup.","og_url":"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/","og_site_name":"Magetop Blog","article_publisher":"https:\/\/www.facebook.com\/MagetopStore","article_published_time":"2025-05-05T16:03:53+00:00","article_modified_time":"2025-05-05T16:03:56+00:00","og_image":[{"width":1355,"height":753,"url":"https:\/\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Configure-Varnish-Cache-In-Magento-2.png","type":"image\/png"}],"author":"Aaron LX","twitter_card":"summary_large_image","twitter_creator":"@MagetopStore","twitter_site":"@MagetopStore","twitter_misc":{"Written by":"Aaron LX","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#article","isPartOf":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/"},"author":{"name":"Aaron LX","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/b8770690a02cc53a273d6b7205229ff7"},"headline":"How To Configure Varnish Cache In Magento 2","datePublished":"2025-05-05T16:03:53+00:00","dateModified":"2025-05-05T16:03:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/"},"wordCount":313,"commentCount":0,"publisher":{"@id":"https:\/\/www.magetop.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Configure-Varnish-Cache-In-Magento-2.png?fit=1355%2C753&ssl=1","keywords":["Configure Varnish Cache","Configure Varnish Cache In Magento 2","How To Configure Varnish Cache In Magento 2","Varnish Cache"],"articleSection":["Magento 2 Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/","url":"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/","name":"How To Configure Varnish Cache In Magento 2 - Magetop Blog","isPartOf":{"@id":"https:\/\/www.magetop.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#primaryimage"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Configure-Varnish-Cache-In-Magento-2.png?fit=1355%2C753&ssl=1","datePublished":"2025-05-05T16:03:53+00:00","dateModified":"2025-05-05T16:03:56+00:00","description":"Varnish Cache is a powerful HTTP accelerator that significantly boosts Magento 2 performance by caching full-page responses. In this guide, you\u2019ll learn How To Configure Varnish Cache In Magento 2 and connect it to your web server setup.","breadcrumb":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#primaryimage","url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Configure-Varnish-Cache-In-Magento-2.png?fit=1355%2C753&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Configure-Varnish-Cache-In-Magento-2.png?fit=1355%2C753&ssl=1","width":1355,"height":753,"caption":"How To Configure Varnish Cache In Magento 2"},{"@type":"BreadcrumbList","@id":"https:\/\/www.magetop.com\/blog\/how-to-configure-varnish-cache-in-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.magetop.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Configure Varnish Cache In Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/www.magetop.com\/blog\/#website","url":"https:\/\/www.magetop.com\/blog\/","name":"Magetop Blog","description":"Exploring Magento Tips, Tricks, and Trends","publisher":{"@id":"https:\/\/www.magetop.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.magetop.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.magetop.com\/blog\/#organization","name":"Magetop.com","url":"https:\/\/www.magetop.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1","width":475,"height":475,"caption":"Magetop.com"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/MagetopStore","https:\/\/x.com\/MagetopStore","https:\/\/www.linkedin.com\/company\/magetop","https:\/\/www.pinterest.com\/magetop","https:\/\/www.youtube.com\/channel\/UCXoiJsz88OfPmwa8QpUkwOA"]},{"@type":"Person","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/b8770690a02cc53a273d6b7205229ff7","name":"Aaron LX","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/11\/475315059_122137709240563546_260104055231757176_n.jpg?fit=96%2C96&#038;ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/11\/475315059_122137709240563546_260104055231757176_n.jpg?fit=96%2C96&#038;ssl=1","caption":"Aaron LX"},"description":"Aaron is a passionate writer, crazy about shopping, eCommerce and trends. Besides his outstanding research skills and a positive mind, Aaron eagerly shares his experience with the readers.","url":"https:\/\/www.magetop.com\/blog\/author\/aaron-lx\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Configure-Varnish-Cache-In-Magento-2.png?fit=1355%2C753&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/paOdw5-2DZ","jetpack-related-posts":[{"id":3659,"url":"https:\/\/www.magetop.com\/blog\/magento-2-configure-full-page-cache\/","url_meta":{"origin":10167,"position":0},"title":"How To Configure Full-Page Cache In Magento 2","author":"Aaron LX","date":"December 10, 2020","format":false,"excerpt":"Magento provides a solution that uses full page caching to improve website performance. Quickly display category, products, CMS pages, improve response time, reduce server load. The special thing is that you can easily enable it in the Admin Panel. In this post, I will guide you How To Configure Full-Page\u2026","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"How To Configure Full-Page Cache In Magento 2","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/12\/How-To-Configure-Full-Page-Cache-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/12\/How-To-Configure-Full-Page-Cache-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/12\/How-To-Configure-Full-Page-Cache-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/12\/How-To-Configure-Full-Page-Cache-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":10143,"url":"https:\/\/www.magetop.com\/blog\/how-to-install-varnish-cache-on-ubuntu\/","url_meta":{"origin":10167,"position":1},"title":"How To Install Varnish Cache on Ubuntu","author":"Aaron LX","date":"May 4, 2025","format":false,"excerpt":"Varnish Cache is a high-performance HTTP accelerator designed to cache and serve content faster, significantly improving web application speed. This guide will walk you through How To Install Varnish Cache on Ubuntu. Steps To Install Varnish Cache on Ubuntu Step 1: Update Your System Keep your server up to date\u2026","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"How To Install Varnish Cache on Ubuntu","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Install-Varnish-Cache-on-Ubuntu.png?fit=1200%2C667&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Install-Varnish-Cache-on-Ubuntu.png?fit=1200%2C667&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Install-Varnish-Cache-on-Ubuntu.png?fit=1200%2C667&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Install-Varnish-Cache-on-Ubuntu.png?fit=1200%2C667&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/05\/How-To-Install-Varnish-Cache-on-Ubuntu.png?fit=1200%2C667&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":6979,"url":"https:\/\/www.magetop.com\/blog\/huong-dan-fix-loi-mat-mega-menu-sau-khi-kich-hoat-varnish-cache-magento-2\/","url_meta":{"origin":10167,"position":2},"title":"H\u01b0\u1edbng d\u1eabn fix l\u1ed7i m\u1ea5t Mega Menu sau khi k\u00edch ho\u1ea1t Varnish Cache Magento 2","author":"Callula Huy","date":"August 2, 2021","format":false,"excerpt":"Trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn b\u1ea1n c\u00e1ch fix l\u1ed7i m\u1ea5t Mega Menu, Navigation\u00a0sau khi k\u00edch ho\u1ea1t Varnish Cache trong Magento 2.","rel":"","context":"In &quot;Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t&quot;","block_context":{"text":"Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t","link":"https:\/\/www.magetop.com\/blog\/vn\/"},"img":{"alt_text":"H\u01b0\u1edbng d\u1eabn fix l\u1ed7i m\u1ea5t Mega Menu sau khi k\u00edch ho\u1ea1t Varnish Cache Magento 2","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/08\/Huong-dan-fix-loi-mat-Mega-Menu-sau-khi-kich-hoat-Varnish-Cache-Magento-2.jpg?fit=1101%2C601&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/08\/Huong-dan-fix-loi-mat-Mega-Menu-sau-khi-kich-hoat-Varnish-Cache-Magento-2.jpg?fit=1101%2C601&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/08\/Huong-dan-fix-loi-mat-Mega-Menu-sau-khi-kich-hoat-Varnish-Cache-Magento-2.jpg?fit=1101%2C601&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/08\/Huong-dan-fix-loi-mat-Mega-Menu-sau-khi-kich-hoat-Varnish-Cache-Magento-2.jpg?fit=1101%2C601&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/08\/Huong-dan-fix-loi-mat-Mega-Menu-sau-khi-kich-hoat-Varnish-Cache-Magento-2.jpg?fit=1101%2C601&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":722,"url":"https:\/\/www.magetop.com\/blog\/how-to-speed-up-magento-2-website\/","url_meta":{"origin":10167,"position":3},"title":"How to Speed Up Magento 2 Website","author":"Adam Roger","date":"November 22, 2019","format":false,"excerpt":"Speeding up your Magento 2 website is very important, it affects user experience. Customers will feel satisfied when your site responds quickly. This will create an impressive and trust of customers for your website. And the following, I will show you some ways to speed up your Magento 2 website.","rel":"","context":"In &quot;Magento 2 Extension Guides &amp; Tech Tips&quot;","block_context":{"text":"Magento 2 Extension Guides &amp; Tech Tips","link":"https:\/\/www.magetop.com\/blog\/magento-2-extension-guides-tech-tips\/"},"img":{"alt_text":"How to speed up magento 2 website","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-speed-up-magento-2-website.png?fit=641%2C431&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-speed-up-magento-2-website.png?fit=641%2C431&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2019\/11\/How-to-speed-up-magento-2-website.png?fit=641%2C431&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":10738,"url":"https:\/\/www.magetop.com\/blog\/magento-2-and-redis-best-practices-for-caching-and-performance-optimization\/","url_meta":{"origin":10167,"position":4},"title":"Magento 2 and Redis: Best Practices for Caching and Performance Optimization","author":"Aaron LX","date":"October 2, 2025","format":false,"excerpt":"Magento 2 Redis best practices are essential for Magento 2 stores to achieve faster page loads and smoother customer experiences. By following proven Redis configuration and caching strategies, merchants can reduce database load, improve session reliability, and boost overall performance. What is Redis in Magento 2? Redis is an open-source\u2026","rel":"","context":"In &quot;Magento 2 Knowledge Base&quot;","block_context":{"text":"Magento 2 Knowledge Base","link":"https:\/\/www.magetop.com\/blog\/magento-2-knowledge-base\/"},"img":{"alt_text":"Magento 2 and Redis Best Practices for Caching and Performance Optimization","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/10\/Magento-2-and-Redis-Best-Practices-for-Caching-and-Performance-Optimization.png?fit=1200%2C667&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/10\/Magento-2-and-Redis-Best-Practices-for-Caching-and-Performance-Optimization.png?fit=1200%2C667&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/10\/Magento-2-and-Redis-Best-Practices-for-Caching-and-Performance-Optimization.png?fit=1200%2C667&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/10\/Magento-2-and-Redis-Best-Practices-for-Caching-and-Performance-Optimization.png?fit=1200%2C667&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/10\/Magento-2-and-Redis-Best-Practices-for-Caching-and-Performance-Optimization.png?fit=1200%2C667&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":6997,"url":"https:\/\/www.magetop.com\/blog\/cai-dat-varnish-cache-tren-windows\/","url_meta":{"origin":10167,"position":5},"title":"H\u01b0\u1edbng d\u1eabn c\u00e1ch c\u00e0i \u0111\u1eb7t Varnish Cache tr\u00ean Windows","author":"Callula Huy","date":"August 2, 2021","format":false,"excerpt":"Trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn b\u1ea1n c\u00e1ch c\u00e0i \u0111\u1eb7t Varnish Cache tr\u00ean Windows.","rel":"","context":"In &quot;Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t&quot;","block_context":{"text":"Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t","link":"https:\/\/www.magetop.com\/blog\/vn\/"},"img":{"alt_text":"H\u01b0\u1edbng d\u1eabn c\u00e1ch c\u00e0i \u0111\u1eb7t Varnish Cache tr\u00ean Windows","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/08\/Huong-dan-cach-cai-dat-Varnish-Cache-tren-Windows.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/08\/Huong-dan-cach-cai-dat-Varnish-Cache-tren-Windows.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/08\/Huong-dan-cach-cai-dat-Varnish-Cache-tren-Windows.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/08\/Huong-dan-cach-cai-dat-Varnish-Cache-tren-Windows.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/08\/Huong-dan-cach-cai-dat-Varnish-Cache-tren-Windows.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/10167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/users\/106"}],"replies":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/comments?post=10167"}],"version-history":[{"count":3,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/10167\/revisions"}],"predecessor-version":[{"id":10172,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/10167\/revisions\/10172"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/media\/10173"}],"wp:attachment":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/media?parent=10167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/categories?post=10167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/tags?post=10167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}