{"id":32740,"date":"2021-01-12T13:35:23","date_gmt":"2021-01-12T18:35:23","guid":{"rendered":"https:\/\/www.boldgrid.com\/support\/?p=32740"},"modified":"2024-12-05T10:09:35","modified_gmt":"2024-12-05T15:09:35","slug":"divi-w3-total-cache-guide","status":"publish","type":"post","link":"https:\/\/www.boldgrid.com\/support\/w3-total-cache\/divi-w3-total-cache-guide\/","title":{"rendered":"How to Configure Divi and W3 Total Cache"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<?xml encoding=\"utf-8\" ?><html><body><p><span style=\"font-weight: 400;\">Divi is more than just a WordPress theme, it&rsquo;s a completely new website building platform that replaces the standard WordPress post editor with a vastly superior visual editor. And when optimized with W3 Total Cache your website will look fantastic and have fantastic performance!<\/span><\/p>\n<p><span style=\"font-weight: 400;\">With the steps below we will show you how to optimize your Divi-built website with W3 Total Cache for your website&rsquo;s best performance!<\/span><\/p>\n<h2 id=\"baseline-divi-web-hosting-with-defaults\"><span style=\"font-weight: 400;\">Baseline: Divi Web Hosting with Defaults<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The first step is to install Divi and build the website. For this guide, we used a Divi Template for a Web Hosting service, and made some modifications to suit our needs. Once the website is built we performed tests on GTMetrix and Google PageSpeed Insights:<\/span><\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_32743\" aria-describedby=\"caption-attachment-32743\" style=\"width: 1024px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/01\/divi-before-w3tc.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-32743\" style=\"box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/01\/divi-before-w3tc-1024x670.png\" alt=\"Before W3TC is configured scores are between 36 and 57\" width=\"1024\" height=\"670\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/01\/divi-before-w3tc-1024x670.png 1024w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/01\/divi-before-w3tc-300x196.png 300w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/01\/divi-before-w3tc-768x502.png 768w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/01\/divi-before-w3tc.png 1052w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption id=\"caption-attachment-32743\" class=\"wp-caption-text\">Before W3TC is configured, scores are between 36 and 57<\/figcaption><\/figure>\n<h2 id=\"install-and-configure-w3-total-cache\"><span style=\"font-weight: 400;\">Install and configure W3 Total Cache<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Once the tests are performed, go to your WordPress dashboard and navigate to <strong>Plugins &gt; Add new<\/strong> and search for&nbsp; W3 Total Cache.<\/span><span style=\"font-weight: 400;\"><br>\n<\/span><span style=\"font-weight: 400;\">The configurations shown here will work in all shared hosting environments. If you are using a more powerful platform like a VPS you can use a memory-based caching solution for Object Caching and Database caching if the database is a bottleneck of your website performance.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In <strong>General Settings,<\/strong> enable <strong>Page Cache<\/strong> and select <strong>Disk: Enhanced<\/strong> for the cache control method.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enable <strong>Minify<\/strong>, set the mode to <strong>Auto<\/strong>, and use <strong>Disk<\/strong> for the caching method.<a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2020\/11\/minify-js-settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-31138\" style=\"box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2020\/11\/minify-js-settings-300x164.png\" alt=\"JS Minify Settings\" width=\"300\" height=\"164\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2020\/11\/minify-js-settings-300x164.png 300w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2020\/11\/minify-js-settings-768x419.png 768w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2020\/11\/minify-js-settings.png 903w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Use these settings for&nbsp;<strong>Minify &gt; General<\/strong>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Enable <strong>Rewrite URL structure<\/strong><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Enable <strong>Disable minify for logged in users<\/strong><\/span><\/li>\n<\/ul>\n<\/li>\n<li aria-level=\"2\">Use these settings for&nbsp;<strong>Minify &gt; HTML &amp; XML:<\/strong>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Enable <strong>HTML Minify<\/strong>&nbsp;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Enable <strong>Inline CSS Minification<\/strong><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Enable <strong>Inline JS Minification<\/strong><\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Use these settings for <strong>Minify &gt; JS<\/strong>:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Enable <strong>JS minify settings<\/strong><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Before &lt;\/head&gt; select <strong>Non-blocking using &ldquo;defer&rdquo;<\/strong><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">After &lt;body&gt; with <strong>Non-blocking using &ldquo;defer&rdquo;<\/strong><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Select <strong>Combine &amp; Minify<\/strong><\/span><\/li>\n<\/ul>\n<\/li>\n<li aria-level=\"2\">Use these settings for&nbsp;<strong>Minify &gt; CSS:<\/strong>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\"><strong>Enable<\/strong> CSS minify<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Enable <strong>Eliminate render-blocking CSS by moving it to the HTTP body<\/strong><\/span><a class=\"btn\" style=\"background-color: #1b8284; color: #fff !important;\" href=\"https:\/\/www.boldgrid.com\/w3-total-cache\/\">Get Premium to enable this feature.<\/a><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In <strong>General Settings<\/strong>, add the following:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\"><strong>Enable<\/strong> Object Cache using <strong>Disk<\/strong><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\"><strong>Enable<\/strong> Browser Cache<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In <strong>Performance &gt; Browser Cache<\/strong>, use the following settings:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">In the General, CSS &amp; JS, HTML &amp; XML, Media &amp; Other Files sections, use these settings:<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Set Last-Modified header<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Set expires header<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Set cache control header<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Set entity tag<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Enable HTTP (gzip) compression<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Don&rsquo;t set cookies for static files<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Set CSS &amp; JS expires header to 31536000 seconds (one year)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Set HTML &amp; XML expires header to 3600 seconds (one hour)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Set Media &amp; Other files expires header to 31536000 seconds (one year)<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Back in <strong>General Settings<\/strong>, enable <strong>Lazy Load Images<\/strong> and <strong>Disable Emoji<\/strong> in the <strong>User Experience<\/strong> section.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Configure An Asset CDN<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Configure a Content Delivery Network, or CDN, to serve all the static assets from the CDN. In this example, we&rsquo;ll be using Stackpath as our CDN, though the steps will be similar for most others. First, log into your CDN and <\/span><a href=\"https:\/\/support.stackpath.com\/hc\/en-us\/articles\/360030828912\"><span style=\"font-weight: 400;\">create credentials<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/support.stackpath.com\/hc\/en-us\/articles\/360001078983-WordPress-with-W3-Total-Cache-CDN-Setup-Guide\"><span style=\"font-weight: 400;\">Configure<\/span><\/a><span style=\"font-weight: 400;\"> W3 Total Cache and Stackpath CDN accordingly<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Next, navigate to <strong>Performance &gt; General<\/strong> and set the CDN Type to <strong>Stackpath (recommended)<\/strong>. Save your changes, then navigate to <strong>Performance &gt; CDN<\/strong>. Then enable the following settings:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><strong>Host attachments<\/strong><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><strong>Host wp-includes\/files<\/strong><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><strong>Host theme files<\/strong><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><strong>Host minified CSS and JS files<\/strong><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><strong>Add Canonical Header<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Make sure to save all settings and purge the cache after the configuration is completed.<\/span><\/p>\n<h2 id=\"speed-test-results\">Speed Test Results<\/h2>\n<p><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/01\/divi-after-w3tc.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-large wp-image-32895\" style=\"box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/01\/divi-after-w3tc-1024x670.png\" alt=\"\" width=\"1024\" height=\"670\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/01\/divi-after-w3tc-1024x670.png 1024w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/01\/divi-after-w3tc-300x196.png 300w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/01\/divi-after-w3tc-768x502.png 768w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/01\/divi-after-w3tc.png 1052w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">As you can see the results of the optimization are fantastic!<\/span><\/p>\n<h3 id=\"important-notes\"><span style=\"font-weight: 400;\">Important notes<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Divi Builder is a very powerful tool that uses a lot of JS to build your pages. To avoid any issues with Divi Builder Please disable Minify for logged in users in <strong>Performance &gt; Minify&gt; Disable Minify for logged in users<\/strong> and also make sure that page caching is disabled for logged in users in <strong>Performance &gt; Page Cache &gt; Don&rsquo;t cache pages for logged in users<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Divi is more than just a WordPress theme, it&rsquo;s a completely new website building platform that replaces the standard WordPress post editor with a vastly superior visual editor. And when optimized with W3 Total Cache your website will look fantastic and have fantastic performance! With the steps below we will show you how to optimize [&hellip;]<\/p>\n","protected":false},"author":1294,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"bgseo_title":"","bgseo_description":"","bgseo_robots_index":"index","bgseo_robots_follow":"follow","footnotes":""},"categories":[738,692],"tags":[],"class_list":["post-32740","post","type-post","status-publish","format-standard","hentry","category-w3tc-getting-started","category-w3-total-cache"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/32740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/users\/1294"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/comments?post=32740"}],"version-history":[{"count":13,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/32740\/revisions"}],"predecessor-version":[{"id":32903,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/32740\/revisions\/32903"}],"wp:attachment":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/media?parent=32740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/categories?post=32740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/tags?post=32740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}