{"id":8500,"date":"2022-09-02T11:48:25","date_gmt":"2022-09-02T11:48:25","guid":{"rendered":"https:\/\/clustercs.com\/kb\/?docs=docly-documentation\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish"},"modified":"2022-09-19T13:11:47","modified_gmt":"2022-09-19T13:11:47","slug":"caching-on-wordpress-using-varnish","status":"publish","type":"docs","link":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/","title":{"rendered":"Caching on WordPress using Varnish"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p><strong>Caching your WordPress using ClusterCS<\/strong><br>Whether you want more speed, a better experience for your visitors, for SEO, or any personal reason, chances are you want a caching layer on your website.<br>Caching in ClusterCS is achieved by spending only a few minutes in the Control Panel.<\/p>\n\n\n\n<p>In order to get started, be sure that you have added&nbsp;<strong>Varnish<\/strong>&nbsp;as a service to your server:<\/p>\n\n\n\n<p><strong>Servers &gt; Manage &gt; Webserver &gt; Manage &gt; Add Varnish &gt; Save<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/chrome_VXsEPSe6NW-1024x709.png\"><img decoding=\"async\" src=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/chrome_VXsEPSe6NW-1024x709.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p>Also be sure that you have&nbsp;<strong>Smart Traffic Manager\/haproxy<\/strong>&nbsp;checked like in the example below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/clustercs_varnish_settings.png\"><img decoding=\"async\" src=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/clustercs_varnish_settings.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p>Start by going in the&nbsp;<strong>Speed tab<\/strong>&nbsp;of your domain.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/cluster_cs_speed_section-1024x162.png\"><img decoding=\"async\" src=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/cluster_cs_speed_section-1024x162.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p>Now you should scroll down to&nbsp;<strong>ADD NEW RULE<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/download-1-1024x500.png\"><img decoding=\"async\" src=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/download-1-1024x500.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p>and set the following conditions, which I will explain lower:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/clustercs_speed_rule_varnish1.png\"><img decoding=\"async\" src=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/clustercs_speed_rule_varnish1.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/clustercs_speed_rule_varnish-1-761x1024.png\"><img decoding=\"async\" src=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/clustercs_speed_rule_varnish-1-761x1024.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p><strong>path begins_with \/<\/strong>&nbsp;\u2013 this is the base path on which the cache layer should be applied. if your WordPress installation is located in a subfolder please adjust accordingly, ex: \u201cpath begins_with \/blog\u201d<\/p>\n\n\n\n<p><strong>path not_ends_with .php<\/strong>&nbsp;\u2013 calls to php files are most likely custom data that should not be cached<\/p>\n\n\n\n<p><strong>cookie \u2013 not_contains \u2013 wordpress_logged_in<\/strong>&nbsp;\u2013 WordPress maintains a cookie which is an indicator of this state \u2013 wordpress_logged_in \u2013 if it caches it, then some private user data may be shown publicly<\/p>\n\n\n\n<p><strong>method \u2013 get&nbsp;<\/strong>\u2013&nbsp;other types usually have important actions being carried and shouldn\u2019t be lost<\/p>\n\n\n\n<p>You will also need a Clear Cache rule that can be set like in the example below:<\/p>\n\n\n\n<p><strong>Clear Cache Rule:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/clustercs_clear_cache.png\"><img decoding=\"async\" src=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/clustercs_clear_cache.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p><strong>IP from Your_IP&nbsp;<\/strong>\u2013 make this specification in order to have the clear cache link accessible only from your location of choice, for security reasons<\/p>\n\n\n\n<p>Don\u2019t forget to set the last option with \u201c<strong>cache_with Webserver\/Varnish<\/strong>\u201d<\/p>\n\n\n\n<p>Once everything is set up, you need to give your domain some time (Might take about 30 minutes to websites with high traffic) to populate the cache. During that time, you may experience some higher resource load, which is totally normal.<\/p>\n\n\n\n<p>For more in-depth details about the Speed Engine, please visit our\u00a0<strong><a href=\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/\">KB Article<\/a><\/strong><\/p>\n\n\n\n<p>Now you can take full advantage of your cache and serve more users, faster!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Caching your WordPress using ClusterCSWhether you want more speed, a better experience for your visitors, for SEO, or any personal reason, chances are you want a caching layer on your website.Caching in ClusterCS is achieved by spending only a few minutes in the Control Panel. In order to get started, be sure that you have [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":8489,"menu_order":11,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-8500","docs","type-docs","status-publish","hentry","no-post-thumbnail"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Caching on WordPress using Varnish - ClusterCS Knowledge Base<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Caching on WordPress using Varnish - ClusterCS Knowledge Base\" \/>\n<meta property=\"og:description\" content=\"Caching your WordPress using ClusterCSWhether you want more speed, a better experience for your visitors, for SEO, or any personal reason, chances are you want a caching layer on your website.Caching in ClusterCS is achieved by spending only a few minutes in the Control Panel. In order to get started, be sure that you have [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/\" \/>\n<meta property=\"og:site_name\" content=\"ClusterCS Knowledge Base\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-19T13:11:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/chrome_VXsEPSe6NW-1024x709.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/\",\"url\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/\",\"name\":\"Caching on WordPress using Varnish - ClusterCS Knowledge Base\",\"isPartOf\":{\"@id\":\"https:\/\/clustercs.com\/kb\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/chrome_VXsEPSe6NW-1024x709.png\",\"datePublished\":\"2022-09-02T11:48:25+00:00\",\"dateModified\":\"2022-09-19T13:11:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/#primaryimage\",\"url\":\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/chrome_VXsEPSe6NW-1024x709.png\",\"contentUrl\":\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/chrome_VXsEPSe6NW-1024x709.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/clustercs.com\/kb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ClusterCS Documentation\",\"item\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Speed Optimizations\",\"item\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Actions\",\"item\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Caching on WordPress using Varnish\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/clustercs.com\/kb\/#website\",\"url\":\"https:\/\/clustercs.com\/kb\/\",\"name\":\"ClusterCS Knowledge Base\",\"description\":\"Welcome to ClusterCS Documentation\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/clustercs.com\/kb\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Caching on WordPress using Varnish - ClusterCS Knowledge Base","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:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/","og_locale":"en_US","og_type":"article","og_title":"Caching on WordPress using Varnish - ClusterCS Knowledge Base","og_description":"Caching your WordPress using ClusterCSWhether you want more speed, a better experience for your visitors, for SEO, or any personal reason, chances are you want a caching layer on your website.Caching in ClusterCS is achieved by spending only a few minutes in the Control Panel. In order to get started, be sure that you have [&hellip;]","og_url":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/","og_site_name":"ClusterCS Knowledge Base","article_modified_time":"2022-09-19T13:11:47+00:00","og_image":[{"url":"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/chrome_VXsEPSe6NW-1024x709.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/","url":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/","name":"Caching on WordPress using Varnish - ClusterCS Knowledge Base","isPartOf":{"@id":"https:\/\/clustercs.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/#primaryimage"},"image":{"@id":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/#primaryimage"},"thumbnailUrl":"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/chrome_VXsEPSe6NW-1024x709.png","datePublished":"2022-09-02T11:48:25+00:00","dateModified":"2022-09-19T13:11:47+00:00","breadcrumb":{"@id":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/#primaryimage","url":"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/chrome_VXsEPSe6NW-1024x709.png","contentUrl":"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2019\/05\/chrome_VXsEPSe6NW-1024x709.png"},{"@type":"BreadcrumbList","@id":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/caching-on-wordpress-using-varnish\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/clustercs.com\/kb\/"},{"@type":"ListItem","position":2,"name":"ClusterCS Documentation","item":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/"},{"@type":"ListItem","position":3,"name":"Speed Optimizations","item":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/"},{"@type":"ListItem","position":4,"name":"Actions","item":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/"},{"@type":"ListItem","position":5,"name":"Caching on WordPress using Varnish"}]},{"@type":"WebSite","@id":"https:\/\/clustercs.com\/kb\/#website","url":"https:\/\/clustercs.com\/kb\/","name":"ClusterCS Knowledge Base","description":"Welcome to ClusterCS Documentation","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/clustercs.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"acf":[],"_links":{"self":[{"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/docs\/8500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/comments?post=8500"}],"version-history":[{"count":3,"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/docs\/8500\/revisions"}],"predecessor-version":[{"id":8994,"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/docs\/8500\/revisions\/8994"}],"up":[{"embeddable":true,"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/docs\/8489"}],"wp:attachment":[{"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/media?parent=8500"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/doc_tag?post=8500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}