{"id":16184,"date":"2023-08-29T04:59:43","date_gmt":"2023-08-29T04:59:43","guid":{"rendered":"https:\/\/cloudkul.com\/blog\/?p=16184"},"modified":"2024-11-29T10:08:23","modified_gmt":"2024-11-29T10:08:23","slug":"cloudflare-cache-purge-and-expire-headers","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/","title":{"rendered":"Cloudflare cache purge and expire headers"},"content":{"rendered":"\n<p>As website owners and developers, we all want our websites to load quickly and provide a great user experience. <\/p>\n\n\n\n<p>One way to achieve this is by using caching, a technique that stores frequently accessed website content in special servers worldwide, making it faster to deliver to users.<\/p>\n\n\n\n<p>Cloudflare is a popular service that offers powerful caching features. It acts like a global network of servers that <a href=\"https:\/\/cloudkul.com\/blog\/what-is-content-delivery-network\/\">stores your website&#8217;s content <\/a>in multiple locations around the world. <\/p>\n\n\n\n<p>Now, let&#8217;s talk about two important aspects of <a href=\"https:\/\/cloudkul.com\/blog\/purge-varnish-cache-remotely-using-cloudflare\/\">Cloudflare caching<\/a>: <strong>cache purge <\/strong>and <strong>expire headers<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Cache Purge<\/strong><\/h2>\n\n\n\n<p>Cache purge is like a refresh button for your cached content. <\/p>\n\n\n\n<p>When you update something on your website, like changing a picture or updating a page, you want your visitors to see the latest version, right? <\/p>\n\n\n\n<p><strong>(a)  Cache Purge via Cloudflare dashboard:-<\/strong><\/p>\n\n\n\n<p>Website owners can log in to their Cloudflare account and use the user-friendly dashboard to purge cached resources manually. <\/p>\n\n\n\n<p>Under the Zones section, select the domain for which you want to purge the cache.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/Zones-Harcharansingh5513-gmail-com-s-Account-Cloudflare.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"847\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/Zones-Harcharansingh5513-gmail-com-s-Account-Cloudflare-1024x847.png\" alt=\"cache\" class=\"wp-image-16185\"\/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Under the Zone overview section, you can see the Purge Cache option on the Top Right side.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/Screenshot.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-1024x512.png\" alt=\"purge\" class=\"wp-image-16187\"\/><\/a><\/figure>\n\n\n\n<p>Now, we have two options to purge the cache Custom Purge and Purge Everything. <br>With <strong>&#8220;Purge Everything,&#8221;<\/strong> we can clear the cache for our domain and subdomains all at once. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"528\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/2-1024x528.png\" alt=\"eveything\" class=\"wp-image-16225\" style=\"width:840px;height:433px\"\/><\/a><\/figure>\n\n\n\n<p>With <strong>&#8220;Custom Purge,&#8221;<\/strong> we can choose which specific content to refresh, leaving the rest unchanged. It lets us update only what we need without affecting the rest of the cache.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/3-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"533\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/3-1-1024x533.png\" alt=\"custom\" class=\"wp-image-16250\"\/><\/a><\/figure>\n\n\n\n<p><strong>(b) Cache Purge via Cloudflare page rule<\/strong><\/p>\n\n\n\n<p>Cloudflare provides an option to bypass the cache using Page Rules. When we remove the cache from Page Rules for bypass, we ensure that certain pages or resources on our website are not cached. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/4.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"485\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/4-1024x485.png\" alt=\"page\" class=\"wp-image-16236\"\/><\/a><\/figure>\n\n\n\n<p>To prevent caching for a specific URL like example.com\/admin, just add it to the Page Rule settings. <\/p>\n\n\n\n<p>Cloudflare will stop caching that URL, ensuring visitors receive fresh, up-to-date content directly from your server. Pick a setting &#8220;<strong>cache Level<\/strong>&#8221; and choose the &#8220;<strong>Bypass<\/strong>&#8221; option in the cache Level.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/5.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1750\" height=\"812\" data-id=\"16392\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/5-1024x475.png\" alt=\"rule\" class=\"wp-image-16392\"\/><\/a><\/figure>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Expire Headers in Cloudflare<\/strong><\/h2>\n\n\n\n<p>Cloudflare&#8217;s &#8220;expire headers&#8221; or &#8220;cache expiration&#8221; feature is essential for improving the performance and speed of your website.<\/p>\n\n\n\n<p><strong> How to configure the Expire Header in Cloudflare:-<\/strong><\/p>\n\n\n\n<ol>\n<li>Go to the &#8220;Caching&#8221; section in the Cloudflare dashboard.<\/li>\n\n\n\n<li>Under the &#8220;Configuration&#8221; settings, you can set up the &#8220;Browser Cache TTL&#8221; to determine how long you want the assets (like images, CSS, and JavaScript files) to be cached in visitors&#8217; browsers. <\/li>\n\n\n\n<li>You can also set the &#8220;Edge Cache TTL&#8221; to determine how long you want Cloudflare to cache the assets on its edge servers. <\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"522\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/6-1024x522.png\" alt=\"headers\" class=\"wp-image-16388\" style=\"width:840px;height:428px\"\/><\/a><\/figure>\n\n\n\n<p>4. If you want to have more control over specific file types or directories, you can use Page Rules to set custom caching rules. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/7-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"517\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/7-1-1024x517.png\" alt=\"create\" class=\"wp-image-16503\"\/><\/a><\/figure>\n\n\n\n<p><strong>Edge Server Cache<\/strong>:- Edge cache plays a crucial role in improving website performance by storing frequently accessed assets on Cloudflare&#8217;s distributed edge servers.<\/p>\n\n\n\n<p>This reduces the time it takes for content to reach users since it is delivered from a server closer to them<\/p>\n\n\n\n<p><strong>Browser Cache<\/strong>: It stores website resources locally on a user&#8217;s device after their first visit. <\/p>\n\n\n\n<p>When they return to the website, their browser can retrieve these cached assets, eliminating the need to download them again from the server. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Need Support?<\/h2>\n\n\n\n<p>Thank You for reading this Blog!<\/p>\n\n\n\n<p>For further more interesting blogs, keep in touch with us. If you need any kind of support, simply raise a ticket at&nbsp;<strong><a href=\"https:\/\/webkul.uvdesk.com\/en\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/webkul.uvdesk.com\/en\/<\/a>.<\/strong><\/p>\n\n\n\n<p>You may also visit our Odoo development services and quality&nbsp;<strong><a href=\"https:\/\/store.webkul.com\/index.php\/Odoo.html\">Odoo Extensions<\/a><\/strong>.<\/p>\n\n\n\n<p><strong>For further help or queries, please&nbsp;<a href=\"https:\/\/cloudkul.com\/contact\/\">contact<\/a>&nbsp;us or raise a&nbsp;<a href=\"https:\/\/webkul.uvdesk.com\/en\/customer\/create-ticket\/\">ticket<\/a>.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As website owners and developers, we all want our websites to load quickly and provide <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":44,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2,87],"tags":[159,851,852,150,850,853,559,849],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Cloudflare cache purge and expire headers - Cloudkul<\/title>\n<meta name=\"description\" content=\"Cloudflare is a popular service that offers caching features. It acts as a global network of servers that stores website&#039;s content in multiple locations.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cloudflare cache purge and expire headers - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"Cloudflare is a popular service that offers caching features. It acts as a global network of servers that stores website&#039;s content in multiple locations.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-29T04:59:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-29T10:08:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/Zones-Harcharansingh5513-gmail-com-s-Account-Cloudflare-1024x847.png\" \/>\n<meta name=\"author\" content=\"Simranpal Singh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/\",\"name\":\"Cloudflare cache purge and expire headers - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2023-08-29T04:59:43+00:00\",\"dateModified\":\"2024-11-29T10:08:23+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/78b8324979606c100bf67758dcde66e1\"},\"description\":\"Cloudflare is a popular service that offers caching features. It acts as a global network of servers that stores website's content in multiple locations.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cloudflare cache purge and expire headers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/78b8324979606c100bf67758dcde66e1\",\"name\":\"Simranpal Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/43e7a3dcfacce1483cdb35cc2ce00609?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/43e7a3dcfacce1483cdb35cc2ce00609?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"Simranpal Singh\"},\"url\":\"https:\/\/cloudkul.com\/blog\/author\/simranpalsingh-cloud246\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cloudflare cache purge and expire headers - Cloudkul","description":"Cloudflare is a popular service that offers caching features. It acts as a global network of servers that stores website's content in multiple locations.","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:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/","og_locale":"en_US","og_type":"article","og_title":"Cloudflare cache purge and expire headers - Cloudkul","og_description":"Cloudflare is a popular service that offers caching features. It acts as a global network of servers that stores website's content in multiple locations.","og_url":"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/","og_site_name":"Cloudkul","article_published_time":"2023-08-29T04:59:43+00:00","article_modified_time":"2024-11-29T10:08:23+00:00","og_image":[{"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/08\/Zones-Harcharansingh5513-gmail-com-s-Account-Cloudflare-1024x847.png"}],"author":"Simranpal Singh","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/","url":"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/","name":"Cloudflare cache purge and expire headers - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2023-08-29T04:59:43+00:00","dateModified":"2024-11-29T10:08:23+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/78b8324979606c100bf67758dcde66e1"},"description":"Cloudflare is a popular service that offers caching features. It acts as a global network of servers that stores website's content in multiple locations.","breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/cloudflare-cache-purge-and-expire-headers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Cloudflare cache purge and expire headers"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/78b8324979606c100bf67758dcde66e1","name":"Simranpal Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/43e7a3dcfacce1483cdb35cc2ce00609?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/43e7a3dcfacce1483cdb35cc2ce00609?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"Simranpal Singh"},"url":"https:\/\/cloudkul.com\/blog\/author\/simranpalsingh-cloud246\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/16184"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/44"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=16184"}],"version-history":[{"count":22,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/16184\/revisions"}],"predecessor-version":[{"id":18709,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/16184\/revisions\/18709"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=16184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=16184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=16184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}