
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Sat, 04 Apr 2026 06:21:16 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Cache Rules are now GA: precision control over every part of your cache]]></title>
            <link>https://blog.cloudflare.com/cache-rules-go-ga/</link>
            <pubDate>Tue, 24 Oct 2023 13:00:40 GMT</pubDate>
            <description><![CDATA[ Today, we're thrilled to share that Cache Rules, along with several other Rules products, are generally available (GA). But that’s not all — we're also introducing new configuration options for Cache Rules ]]></description>
            <content:encoded><![CDATA[ <p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/23yqkja301zV4TfUtTrL0D/1619ec8778be0841f28ddd0fc07a03ba/Cache-Rules-GA-1.png" />
            
            </figure><p>One year ago we introduced Cache Rules, a new way to customize cache settings on Cloudflare. Cache Rules provide greater flexibility for how users cache content, offering precise controls, a user-friendly API, and seamless Terraform integrations. Since it was released in late September 2022, over 100,000 websites have used Cache Rules to fine-tune their cache settings.</p><p>Today, we're thrilled to announce that Cache Rules, along with several other <a href="https://developers.cloudflare.com/rules/">Rules products</a>, are <b>generally available (GA)</b>. But that’s not all — we're also introducing new configuration options for Cache Rules that provide even more options to customize how you cache on Cloudflare. These include functionality to define what resources are eligible for <a href="https://developers.cloudflare.com/cache/advanced-configuration/cache-reserve/">Cache Reserve</a>, what <a href="https://developers.cloudflare.com/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#error-524-a-timeout-occurred">timeout values</a> should be respected when receiving data from your origin server, which <a href="https://developers.cloudflare.com/fundamentals/reference/network-ports/#network-ports-compatible-with-cloudflares-proxy">custom ports</a> we should use when we cache content, and whether we should bypass Cloudflare’s cache in the absence of a <a href="https://developers.cloudflare.com/cache/concepts/cache-control/#cache-control-directives">cache-control</a> header.</p><p>Cache Rules give users full control and the ability to tailor their content delivery strategy for almost any use case, without needing to write code. As Cache Rules go GA, we are incredibly excited to see how fast customers can achieve their perfect cache strategy.</p>
    <div>
      <h3>History of Customizing Cache on Cloudflare</h3>
      <a href="#history-of-customizing-cache-on-cloudflare">
        
      </a>
    </div>
    <p>The journey of <a href="https://www.cloudflare.com/learning/cdn/what-is-caching/">cache</a> customization on Cloudflare began more than a decade ago, right at the beginning of the company. From the outset, one of the most frequent requests from our customers involved simplifying their configurations. Customers wanted to easily implement precise cache policies, apply robust security measures, manipulate headers, set up redirects, and more for any page on their website. Using Cloudflare to set these controls was especially crucial for customers utilizing origin servers that only provided convoluted configuration options to add headers or policies to responses, which could later be applied downstream by <a href="https://www.cloudflare.com/learning/cdn/what-is-a-cdn/">CDNs</a>.</p><p>In response to this demand, we introduced Page Rules, a product that has since witnessed remarkable growth in both its popularity and functionality. Page Rules became the preferred choice for customers seeking granular control over how Cloudflare caches their content. Currently, there are over 5 million active cache-related Page Rules, assisting websites in tailoring their content delivery strategies.</p><p>However, behind the scenes, Page Rules encountered a scalability issue.</p><p>Whenever a Page Rule is encountered by Cloudflare we must transform all rule conditions for a customer into a single regex pattern. This pattern is then applied to requests for the website to achieve the desired cache configuration. When thinking about how all the regexes from all customers are then compared against tens of millions of requests per second, spanning across more than 300 data centers worldwide, it’s easy to see that the computational demands for applying Page Rules can be immense. This pressure is directly tied to the number of rules we could offer our users. For example, Page Rules would only allow for 125 rules to be deployed on a given website.</p><p>To address this challenge, we rebuilt all the Page Rule functionality on the new <a href="https://developers.cloudflare.com/ruleset-engine/">Rulesets Engine</a>. Not only do ruleset engine-based products give users more rules to play with, they also offer greater flexibility on when these rules should run. Part of the magic of the Rulesets engine is that rather than combine all of a page's rules into a single regular expression, rule logic can be evaluated on a conditional basis. For example, if <a href="https://developers.cloudflare.com/dns/manage-dns-records/how-to/create-subdomain/">subdomain</a> A and B have different caching policies, a request from subdomain A can be evaluated using regex logic specific to A (while omitting any logic that applies to B). This yields meaningful benefits to performance, and reduces the computational demands of applying Page Rules across Cloudflare's network.</p><p>Over the past year, Cache Rules, along with Origin Rules, Configuration Rules, and Single Redirect Rules, have been in beta. Thanks to the invaluable support of our early adopters, we have successfully fine-tuned our product, reaching a stage where it is ready to transition from beta to GA. These products can now accomplish everything that Page Rules could and more. This also marks the beginning of the <a href="https://en.wikipedia.org/wiki/End-of-life_product">EOL</a> process for Page Rules. In the coming months we will announce timelines and information regarding how customers will replace their Page Rules with specific Rules products. We will automate this as much as possible and provide simple steps to ensure a smooth transition away from Page Rules for everyone.</p>
    <div>
      <h3>How to use Cache Rules and What’s New</h3>
      <a href="#how-to-use-cache-rules-and-whats-new">
        
      </a>
    </div>
    <p>Those that have used Cache Rules know that they are intuitive and work similarly to our other <a href="https://developers.cloudflare.com/ruleset-engine/">ruleset engine</a> products. User-defined criteria like URLs or request headers are evaluated, and if matching a specified value, the Cloudflare caching configuration is obeyed. Each Cache Rule depends on fields, operators, and values. For all the different options available, you should see our Cache Rules <a href="https://developers.cloudflare.com/cache/about/cache-rules/">documentation</a>.</p><p>Below are two examples of how to deploy different strategies to customize your cache. These examples only show the tip-of-the-iceberg of what’s possible with Cache Rules, so we encourage you to try them out and let us know what you think.</p>
    <div>
      <h4>Example: Cached content is updated at a regular cadence</h4>
      <a href="#example-cached-content-is-updated-at-a-regular-cadence">
        
      </a>
    </div>
    <p>As an example, let’s say that Acme Corp wants to update their caching strategy. They want to customize their cache to take advantage of certain request headers and use the presence of those request headers to be the criteria that decides when to apply different cache rules. The first thing they’d need to decide is what information should be used to trigger the specific rule. This is defined in the <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/">expression</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2kfN0DJOJ9myEPesXCu6fw/7218e39e9ffbaa96d6ae0e96e6a4862d/Screenshot-2023-10-18-at-6.27.59-PM.png" />
            
            </figure><p>Once the triggering criteria is defined Acme Corp should next determine how they want to customize their cache.</p>
    <div>
      <h4>Content changing quickly</h4>
      <a href="#content-changing-quickly">
        
      </a>
    </div>
    <p>The most common cache strategy is to update the <a href="https://developers.cloudflare.com/cache/how-to/cache-rules/#create-cache-rules-in-the-dashboard">Edge Cache TTL</a>. If Acme Corp thinks a particular piece of content on their website might change quickly, they can alter the time Cloudflare should consider a resource eligible to be served from cache to be shorter. This way Cloudflare would go back to the origin more frequently to <a href="https://developers.cloudflare.com/cache/concepts/cache-control/#:~:text=If%20the%20content%20is%20stale%20in%20Cloudflare%E2%80%99s%20cache%2C%20Cloudflare%20attempts%20to%20revalidate%20the%20content%20with%20the%20origin%20before%20serving%20the%20response%20to%20the%20client.">revalidate and update the content</a>. The Edge Cache TTL section is also where Acme Corp can define a resource’s TTL based on the status code Cloudflare gets back from their origin, and what Cloudflare should cache if there aren’t any cache-control instructions sent from Acme’s origin server.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2swqQzRX7v3UropZSNRbjH/86bac883296e8c5502e6b5a08e5b5df9/Screenshot-2023-10-08-at-4.14.17-PM.png" />
            
            </figure>
    <div>
      <h4>Content changing slowly</h4>
      <a href="#content-changing-slowly">
        
      </a>
    </div>
    <p>On the other hand, if Acme Corp had a lot of content that did not change very frequently (like a favicon or logo) and they preferred to serve that from Cloudflare’s cache instead of their origin, they can define which content should be eligible for <a href="https://developers.cloudflare.com/cache/advanced-configuration/cache-reserve/">Cache Reserve</a> with a new Cache Rule. Cache Reserve reduces egress fees by storing assets persistently in Cloudflare's cache for an extended period of time.</p><p>Traditionally when a user would enable Cache Reserve, their entire zone would be eligible to be written to Cache Reserve. For customers that care about saving origin <a href="https://www.cloudflare.com/learning/cloud/what-are-data-egress-fees/">egress fees</a> on all resources on their website, this is still the best path forward. But for customers that want to have additional control over precisely what assets should be part of their Cache Reserve or even what size of assets should be eligible, the Cache Reserve Eligibility Rule provides additional knobs so that customers can precisely increase their cache hits and reduce origin egress in a customized manner. Note that this rule requires a Cache Reserve subscription.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7b22znoAtsYBjMbufZhP9q/04b5ab28becee5d25d87f558efc1cb44/Screenshot-2023-10-08-at-4.14.48-PM.png" />
            
            </figure>
    <div>
      <h3>Example: Origin is slow</h3>
      <a href="#example-origin-is-slow">
        
      </a>
    </div>
    <p>Let’s consider a hypothetical example. Recently, Acme Corp has been seeing an increase in errors in their Cloudflare logs. These errors are related to a new report that Acme is providing its users based on Acme’s proprietary data. This report requires that their origin access several databases, perform some calculations and generate the report based on these calculations. The origin generating this report needs to wait to respond until all of this background work is completed. Acme’s report is a success, generating an influx of traffic from visitors wanting to see it. But their origin is struggling to keep up. A lot of the errors they are seeing are 524s which correlate to Cloudflare not seeing an origin response before a timeout occurred.</p><p>Acme has plans to improve this by scaling their origin infrastructure but it’s taking a long time to deploy. In the meantime, they can turn to Cache Rules to configure a timeout to be longer. Historically the timeout value between Cloudflare and two successive origin reads was 100 seconds, which meant that if an origin didn't successfully send a response for a period lasting longer than 100 seconds, it could lead to a 524 error. By using a Cache Rule to extend this timeout, Acme Corp can rely more heavily on Cloudflare's cache.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1XqipB1JsifcQLUyGn40BB/5bc7e324c62ab607e2c30c665849f67b/Screenshot-2023-10-18-at-6.21.32-PM.png" />
            
            </figure><p>The above cache strategies focus on how often a resource is changed on an origin, and the origin’s performance. But there are numerous other rules that allow for other strategies, like <a href="https://developers.cloudflare.com/cache/how-to/cache-keys/">custom cache keys</a> which allow for customers to determine how their cache should be defined on Cloudflare, respecting <a href="https://developers.cloudflare.com/cache/reference/etag-headers/">strong ETags</a> which help customers determine when Cloudflare should revalidate particular cached assets, and custom ports which allow for customers to define <a href="https://developers.cloudflare.com/fundamentals/reference/network-ports/#network-ports-compatible-with-cloudflares-proxy">non-standard ports</a> that Cloudflare should use when making caching decisions about content.</p><p>The full list of Cache Rules can be found <a href="https://developers.cloudflare.com/cache/how-to/cache-rules/">here</a>.</p>
    <div>
      <h3>Try Cache Rules today!</h3>
      <a href="#try-cache-rules-today">
        
      </a>
    </div>
    <p>We will continue to build and release additional rules that provide powerful, easy to enable control for anyone using Cloudflare’s cache. If you have feature requests for additional Cache Rules, please let us know in the <a href="https://community.cloudflare.com/">Cloudflare Community</a>.</p><p>Go to the <a href="https://dash.cloudflare.com/caching/cache-rules">dashboard</a> and try Cache Rules out today!</p> ]]></content:encoded>
            <category><![CDATA[General Availability]]></category>
            <category><![CDATA[Cache Rules]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Application Services]]></category>
            <category><![CDATA[Performance]]></category>
            <category><![CDATA[Cache]]></category>
            <category><![CDATA[Connectivity Cloud]]></category>
            <guid isPermaLink="false">4GOWR9PBxeYrH9OGO3zxjZ</guid>
            <dc:creator>Alex Krivit</dc:creator>
        </item>
        <item>
            <title><![CDATA[Dynamic URL redirects: 301 to the future]]></title>
            <link>https://blog.cloudflare.com/dynamic-redirect-rules/</link>
            <pubDate>Tue, 27 Sep 2022 13:00:00 GMT</pubDate>
            <description><![CDATA[ With Dynamic redirects, users can redirect visitors to another webpage or website based upon hundreds of options such as the visitor's country of origin or language, without having to write a single ]]></description>
            <content:encoded><![CDATA[ <p></p><p>The Internet is a dynamic place. Websites are constantly changing as technologies and business practices evolve. What was front-page news is quickly moved into a sub-directory. To ensure website visitors continue to see the correct webpage even if it has been moved, administrators often implement URL redirects.</p><p>A URL redirect is a mapping from one location on the Internet to another, effectively telling the visitor's browser that the location of the page has changed, and where they can now find it. This is achieved by providing a virtual ‘link’ between the content’s original and new location.</p><p>URL Redirects have typically been implemented as Page Rules within Cloudflare, however Page Rules only match on the URL, rather than other elements such as the visitor's source country or preferred language. This limitation meant customers with a need for more dynamic URL redirects had to implement alternative solutions such Cloudflare Workers to achieve their goals.</p><p>To simplify the management of these more complex use cases we have created <b>Dynamic Redirects.</b> With Dynamic Redirects, users can redirect visitors to another webpage or website based upon hundreds of options such as the visitor's country of origin or language, without having to write a single line of code.</p>
    <div>
      <h3>More than a URL</h3>
      <a href="#more-than-a-url">
        
      </a>
    </div>
    <p>For nine years users were limited to 125 URL redirects per zone. This limitation meant those with a need for more URL redirects had to implement alternative solutions such <a href="https://workers.cloudflare.com/">Cloudflare Workers</a> to achieve their goals.</p><p>In December 2021, we launched <a href="/maximum-redirects-minimum-effort-announcing-bulk-redirects/">Bulk Redirects</a>, allowing up to 100,000 URL redirects per account at the time. In April 2022 we increased this maximum number to <b>over six million</b> URL redirects per account. However, there is still a gap in the ‘URL redirect’ product unfulfilled. Until now.</p><p>Bulk Redirects, much like the ‘Forwarding URL’ Page Rule, are prescriptive URL redirects. You tell us what URL to look for, and where to redirect the user to when they visit it. We can support this use case at a huge scale.</p><table>
<thead>
  <tr>
    <th>If a visitor asks for..</th>
    <th>Redirect them to…</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>https://www.cloudflare.com/r2-storage</td>
    <td>https://www.cloudflare.com/products/r2</td>
  </tr>
  <tr>
    <td>https://www.cloudflare.com/apishield</td>
    <td>https://www.cloudflare.com/products/api-gateway</td>
  </tr>
  <tr>
    <td>https://www.cloudflare.com/welcome-center</td>
    <td>https://developers.cloudflare.com/fundamentals/get-started/</td>
  </tr>
</tbody>
</table><p>That's a simple concept to understand, however user needs have evolved. What if a user wanted to redirect visitors to a localized version of the requested page based on their preferred language? What if a user wanted to redirect visitors to their local subsidiary on the website? Or direct them to an optimized site when they visit from a mobile device? Suddenly, this well understood concept doesn’t work - and they have to deploy code in Workers to solve what is actually a common problem. And common problems deserve to be productized.</p><p>This is where Dynamic Redirects can help. The new product provides the same consistent user interface as Transform Rules, Custom Rules, Bulk Redirects, etc. and provides a new action allowing for the target URL to be dynamically created, much like the dynamic rewrite action offered in <a href="https://developers.cloudflare.com/rules/transform/url-rewrite/">Transform Rules</a>.</p><p>This dynamic action frees the user from having to define explicitly what the target URL should look like, and instead provides them with a full gamut of fields and functions to custom generate the target URL based upon the parameters of the request. For example, rather than redirecting all traffic for <a href="http://www.example.com/shop"><code>www.example.com/shop</code></a> to <a href="http://www.example.com/en/shop"><code>www.example.com/en/shop</code></a>, users can conceptually redirect the traffic to <a href="http://www.example.com/%7BPREFERRED_LANGUAGE%7D/shop"><code>www.example.com/{PREFERRED_LANGUAGE}/shop</code></a> (not actual syntax!). With this, traffic from a browser with a preferred language of French will be redirected to <a href="http://www.example.com/fr/shop"><code>www.example.com/fr/shop</code></a>, likewise those with a preferred language of German will be redirected to <a href="http://www.example.com/de/shop"><code>www.example.com/de/shop</code></a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/KSMb1ZP3E4N1nFuUPDFde/34686a5ace57a0d4922a2a0d01befd35/image3-38.png" />
            
            </figure><p>The other big difference between Dynamic Redirects and  Page Rules is in the filtering. Page Rules are limited to filtering on a URL, or a URL with asterisks as wildcards. Dynamic Redirects is built atop our lightning-fast <a href="https://developers.cloudflare.com/ruleset-engine/about/rulesets/">Rulesets Engine</a>, which also runs products such as Transform Rules, Custom Rules (WAF), Bulk Redirects and API Shield.</p><p>Due to this, Dynamic Redirects offers almost the entire suite of Ruleset Engine <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/fields">fields</a> for use in filtering; from <code>http.request.full_uri</code> for the whole URL, to <code>ip.geoip.country</code> (where is the visitor located) and <code>http.request.accepted_languages[]</code> (the language preferred by the visitor). The possibilities are endless.</p><p>Users can also now use <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/operators/">logical operators</a> such as ‘OR’. Where previously, if a user wanted to redirect five distinct URLs to the same URL they would need to deploy five Page Rules. Today, they can simply use an ‘OR’ to consolidate this use case into just one Dynamic Redirect rule:</p><table>
<thead>
  <tr>
    <th>#</th>
    <th>Expression</th>
    <th>Destination URL</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>1</td>
    <td>(http.request.full_uri eq "https:/www.cloudflare.com/partners/integrations/") or (http.request.full_uri eq "https:/www.cloudflare.com/partners/become-a-partner/") or (http.request.full_uri eq "https:/www.cloudflare.com/partners/digital-agency/") or (http.request.full_uri eq "https:/www.cloudflare.com/partners/technology-integrator/") or (http.request.full_uri eq "https:/www.cloudflare.com/partners/view-partners/")</td>
    <td>www.cloudflare.com/partners/</td>
  </tr>
</tbody>
</table><p>We can further simplify this use case in the future by adding hostname lists, allowing users to add URLs to a list and reference it from within the rule expression, similar to IP Lists. This allows an expression like (http.request.full_uri in $vanity_urls), for example.</p>
    <div>
      <h3>A dedicated quota, just for U(RL)</h3>
      <a href="#a-dedicated-quota-just-for-u-rl">
        
      </a>
    </div>
    <p>Page Rules are used to set everything from configuration and caching behaviour to header modification and also URL redirection (Forwarding URL). This means that users tend to run out of available rules quickly.</p><p>To address this, we’re matching the Page Rule quota in each of the four new products that are being announced today. This means where in Page Rules an Enterprise customer would get 125 Page Rules to share amongst the aforementioned functions, in Dynamic Redirects they have 125 rules just for redirects. This number can be increased for Enterprise customers, also.</p><p>We’re also increasing the quota for free plans; where today free plans get three Page Rules, they will now get 10 rules for dynamic redirects, along with each of the other three products (cache, origin, config rules). That's a net increase of 37 additional rules!</p><table>
<thead>
  <tr>
    <th>Plan</th>
    <th>Page Rules</th>
    <th>Dynamic Redirects</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>Enterprise</td>
    <td>125</td>
    <td>125+</td>
  </tr>
  <tr>
    <td>Business</td>
    <td>50</td>
    <td>50</td>
  </tr>
  <tr>
    <td>Pro</td>
    <td>20</td>
    <td>25</td>
  </tr>
  <tr>
    <td>Free</td>
    <td>3</td>
    <td>10</td>
  </tr>
</tbody>
</table><p>Users can now get more out of their Cloudflare setup, being more specific about when traffic is redirected, optimizing cache and adjusting which settings are and aren't applied - without having to trade off between these areas due to a limit in rules quota.</p>
    <div>
      <h3>Localized redirects</h3>
      <a href="#localized-redirects">
        
      </a>
    </div>
    <p>One of the examples covered earlier is being able to redirect visitors to localized content depending on their preferred language.</p><p>This can be done by analyzing the ‘Accept-Language’ header sent by the browser, which is stored as an array in the field http.request.accepted_languages[]. This field is an array of the values received by Cloudflare within the Accept-Language HTTP request header, sorted in descending weight order. This header is calculated based on the preferences set by the visitor in the ‘Language’ section of their web browser.</p><p>For example, if the visitors browser sends an 'Accept-Language' header containing "Accept-Language: fr-CH, fr;q=0.8, en;q=0.9, de;q=0.7, *;q=0.5", then the field http.request.accepted_languages[0] would contain "en", with http.request.accepted_languages[1] containing "fr" and so forth.</p><p>With this information, we can create a dynamic redirect using the action:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/ffOgGltGbr8MSOJW90DP7/10d53bb20a79d263460ec13cff47a110/image1-62.png" />
            
            </figure><p>With this rule in place, traffic from visitors with a preferred language of English (en) will be redirected to <a href="http://www.example.com/en/shop"><code>www.example.com/en/shop</code></a>. The rule can be duplicated for other languages also, ensuring those with a preferred language of French (fr) will be redirected to <a href="http://www.example.com/fr/shop"><code>www.example.com/fr/shop</code></a>.</p>
    <div>
      <h3>Mobile redirects, cookie redirects, …</h3>
      <a href="#mobile-redirects-cookie-redirects">
        
      </a>
    </div>
    <p>There are so many use cases for Dynamic Redirects we couldn't fit them all in this blog.</p><p>Other possible use cases include mobile redirects, redirects based on cookies, redirects to different endpoints based on request headers for live testing. The potential list is huge, and we can't wait to hear what you come up with. Try it <a href="https://dash.cloudflare.com/?to=/:account/:zone/rules/">today</a>!</p><p>If you want to read more, refer to our <a href="https://developers.cloudflare.com/rules/url-forwarding/single-redirects/">documentation</a>.</p><p>
</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Page Rules]]></category>
            <category><![CDATA[Origin Rules]]></category>
            <category><![CDATA[Cache Rules]]></category>
            <category><![CDATA[Config Rules]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">5x03cYdI8N8okRttILtgh3</guid>
            <dc:creator>Sam Marsh</dc:creator>
        </item>
        <item>
            <title><![CDATA[Introducing Cache Rules: precision caching at your fingertips]]></title>
            <link>https://blog.cloudflare.com/introducing-cache-rules/</link>
            <pubDate>Tue, 27 Sep 2022 13:00:00 GMT</pubDate>
            <description><![CDATA[ We have spent the last ten years learning how customers use Page Rules to customize their cached content, and it’s clear the time is ripe for evolving rules-based caching on Cloudflare ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Ten years ago, in 2012, we released a product that put “a powerful new set of tools” in the hands of Cloudflare customers, allowing website owners to control how Cloudflare would cache, apply security controls, manipulate headers, implement redirects, and more on any page of their website. This product is called <a href="/introducing-pagerules-fine-grained-feature-co/">Page Rules</a> and since its introduction, it has grown substantially in terms of popularity and functionality.</p><p>Page Rules are a common choice for customers that want to have fine-grained control over how Cloudflare should cache their content. There are more than 3.5 million caching Page Rules currently deployed that help websites customize their content. We have spent the last ten years learning how customers use those rules to cache content, and it’s clear the time is ripe for evolving rules-based caching on Cloudflare. This evolution will allow for greater flexibility in caching different types of content through additional rule configurability, while providing more visibility into when and how different rules interact across Cloudflare’s ecosystem.</p><p>Today, we’ve <a href="/future-of-page-rules">announced</a> that Page Rules will be re-imagined into four product-specific rule sets: Origin Rules, Cache Rules, Configuration Rules, and Redirect Rules.</p><p>In this blog we’re going to discuss <b>Cache Rules</b>, and how we’re applying ten years of product iteration and learning from Page Rules to give you the tools and options to best optimize your cache.</p>
    <div>
      <h3>Activating Page Rules, then and now</h3>
      <a href="#activating-page-rules-then-and-now">
        
      </a>
    </div>
    <p>Adding a Page Rule is very simple: users either make an API call or navigate to the dashboard, enter a full or wildcard URL pattern (e.g. <code>example.com/images/scr1.png</code> or <code>example.com/images/scr*</code>), and tell us which actions to perform when we see that pattern. For example a Page Rule could tell browsers– keep a copy of the response longer via “<a href="https://developers.cloudflare.com/cache/about/edge-browser-cache-ttl/">Browser Cache TTL</a>”, or tell our cache that via “<a href="https://developers.cloudflare.com/cache/about/edge-browser-cache-ttl/">Edge Cache TTL</a>”. Low effort, high impact. All this is accomplished without fighting origin configuration or writing a single line of code.</p><p>Under the hood, a lot is happening to make that rule scale: we turn every rule condition into regexes, matching them against the tens of millions of requests per second across 275+ data centers globally. The compute necessary to process and apply new values on the fly across the globe is immense and corresponds directly to the number of rules we are able to offer to users. By moving cache actions from Page Rules to Cache Rules we can allow for users to not only set more rules, but also to trigger these rules more precisely.</p>
    <div>
      <h3>More than a URL</h3>
      <a href="#more-than-a-url">
        
      </a>
    </div>
    <p>Users of Page Rules are limited to specific URLs or URL patterns to define how browsers or Cloudflare cache their websites files. Cache Rules allows users to set caching behavior on additional criteria, such as the HTTP request headers or the requested file type. Users can continue to match on the requested URL also, as used in our Page Rules example earlier. With Cache Rules, users can now define this behavior on one or more <a href="https://developers.cloudflare.com/cache/about/cache-rules/">fields</a> available.</p><p>For example, if a user wanted to specify cache behavior for all <code>image/png</code> content-types, it’s now as simple as pushing a few buttons in the UI or writing a small expression in the API. Cache Rules give users precise control over when and how Cloudflare and browsers cache their content. Cache Rules allow for rules to be triggered on request header values that can be simply defined like</p><p><code>any(http.request.headers["content-type"][*] == "image/png")</code></p><p>Which triggers the Cache Rule to be applied to all <code>image/png</code> media types. Additionally, users may also leverage other request headers like cookie values, user-agents, or hostnames.</p><p>As a plus, these matching criteria can be stacked and configured with operators like <code>AND</code> and <code>OR</code>, providing additional simplicity in building complex rules from many discrete blocks, e.g. if you would like to target both <code>image/png</code> AND <code>image/jpeg</code>.</p><p>For the full list of fields available conditionals you can apply Cache Rules to, please refer to the <a href="https://developers.cloudflare.com/cache/about/cache-rules/">Cache Rules documentation</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6LQO30zIpO4qewcrGtY9Gu/0d472c4b0a4f76513613c1e8b1c9e47e/image1-59.png" />
            
            </figure>
    <div>
      <h3>Visibility into how and when Rules are applied</h3>
      <a href="#visibility-into-how-and-when-rules-are-applied">
        
      </a>
    </div>
    <p>Our current offerings of Page Rules, Workers, and Transform Rules can all manipulate caching functionality for our users’ content. Often, there is some trial and error required to make sure that the confluence of several rules and/or Workers are behaving in an expected manner.</p><p>As part of upgrading Page Rules we have separated it into four new products:</p><ol><li><p>Origin Rules</p></li><li><p>Cache Rules</p></li><li><p>Configuration Rules</p></li><li><p>Redirect Rules</p></li></ol><p>This gives users a better understanding into how and when different parts of the Cloudflare stack are activated, reducing the spin-up and debug time. We will also be providing additional visibility in the dashboard for when rules are activated as they go through Cloudflare. As a sneak peek please see:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6f1aHsgVHcPsfCsLvqyzVH/91f25d4d2e9e3881b736bfac12855bdc/Screenshot-2022-09-27-at-13.03.15.png" />
            
            </figure><p>Our users may take advantage of this strict precedence by chaining the results of one product into another. For example, the output of URL rewrites in Transform Rules will feed into the actions of Cache Rules, and the output of Cache Rules will feed into IP Access Rules, and so on.</p><p>In the future, we plan to increase this visibility further to allow for inputs and outputs across the rules products to be observed so that the modifications made on our network can be observed before the rule is even deployed.</p>
    <div>
      <h3>Cache Rules. What are they? Are they improved? Let’s find out!</h3>
      <a href="#cache-rules-what-are-they-are-they-improved-lets-find-out">
        
      </a>
    </div>
    <p>To start, Cache Rules will have all the caching functionality currently available in Page Rules. Users will be able to:</p><ul><li><p>Tell Cloudflare to cache an asset or not,</p></li><li><p>Alter how long Cloudflare should cache an asset,</p></li><li><p>Alter how long a browser should cache an asset,</p></li><li><p>Define a custom cache key for an asset,</p></li><li><p>Configure how Cloudflare serves stale, revalidates, or otherwise uses header values to direct cache freshness and content continuity,</p></li></ul><p>And so much more.</p><p>Cache Rules are intuitive and work similarly to our other <a href="https://developers.cloudflare.com/ruleset-engine/">ruleset engine</a>-based products announced today: API or UI conditionals for URL or request headers are evaluated, and if matching, Cloudflare and browser caching options are configured on behalf of the user. For all the different options available, see our Cache Rules <a href="https://developers.cloudflare.com/cache/about/cache-rules/">documentation</a>.</p><p>Under the hood, Cache Rules apply targeted rule applications so that additional rules can be supported per user and across the whole engine. What this means for our users is that by consuming less CPU for rule evaluations, we’re able to support more rules per user. For specifics on how many additional Cache Rules you’ll be able to use, please see the <a href="/future-of-page-rules">Future of Rules Blog</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5eNSfTxWDVu2FsRc8JKyIZ/f2a109d9a6b63eebfaa9dcd4f9160b1d/image2-49.png" />
            
            </figure>
    <div>
      <h3>How can you use Cache Rules today?</h3>
      <a href="#how-can-you-use-cache-rules-today">
        
      </a>
    </div>
    <p><b>Cache Rules</b> are available today in beta and can be configured via the <a href="https://developers.cloudflare.com/cache/about/cache-rules/#create-cache-rules-via-api">API</a>, Terraform, or UI in the Caching tab of the dashboard. We welcome you to try the functionality and provide us feedback for how they are working or what additional features you’d like to see via community posts, or however else you generally get our attention ?.</p><p>If you have Page Rules implemented for caching on the same path, Cache Rules will take precedence by design. For our more patient users, we plan on releasing a one-click migration tool for Page Rules in the near future.</p>
    <div>
      <h3>What’s in store for the future of Cache Rules?</h3>
      <a href="#whats-in-store-for-the-future-of-cache-rules">
        
      </a>
    </div>
    <p>In addition to granular control and increased visibility, the new rules products also opens the door to more complex features that can recommend rules to help customers achieve better cache hit ratios and reduce their egress costs, adding additional caching actions and visibility, so you can see precisely how Cache Rules will alter headers that Cloudflare uses to cache content, and allowing customers to run experiments with different rule configurations and see the outcome firsthand. These possibilities represent the tip of the iceberg for the next iteration of how customers will use rules on Cloudflare.</p>
    <div>
      <h3>Try it out!</h3>
      <a href="#try-it-out">
        
      </a>
    </div>
    <p>We look forward to you trying Cache Rules and providing feedback on what you’d like to see us build next.</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Cache]]></category>
            <category><![CDATA[CDN]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Cache Rules]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">5F0VFOCMwG7EXVL6kqOXuK</guid>
            <dc:creator>Alex Krivit</dc:creator>
        </item>
        <item>
            <title><![CDATA[The future of Page Rules]]></title>
            <link>https://blog.cloudflare.com/future-of-page-rules/</link>
            <pubDate>Tue, 27 Sep 2022 13:00:00 GMT</pubDate>
            <description><![CDATA[ Learn about four new products that will eventually replace Page Rules by putting more power into the hands of users. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Page Rules is one of our most well-used products. Adopted by millions of users, it is used for configuring everything from cache to security levels. It is the ‘If This Then That’ of Cloudflare. Where the ‘If…’ is a URL, and the ‘Then That’ is changing how we handle traffic to specific parts of a ‘zone’. But it's not without its limitations.</p><p>Page Rules can only trigger on a URL or URL pattern. There is a maximum of 125 Page Rules per zone. Page Rules are also tricky to debug. Even the idea of a “Page” sounds rather old-fashioned now.</p><p>We’re replacing Page Rules with four new dedicated products, offering increased rules quota, more functionality, and better granularity. These products are available immediately for testing. Page Rules is not going away yet, but we do anticipate being able to formally begin the end-of-life process soon.</p>
    <div>
      <h3>Why change?</h3>
      <a href="#why-change">
        
      </a>
    </div>
    <p>In the 10 years since it <a href="/introducing-pagerules-fine-grained-feature-co/">launched</a>, Page Rules has become a well established product, and a very well adopted one. One <i>million</i> Page Rules have been deployed in the past three months alone.</p><p>Page Rules are used to tune how long files should be cached. Page Rules are used to override zone-wide settings for certain URLs. Page Rules are used to create simple URL redirects. Page Rules are used to selectively add/remove HTTP headers. Page Rules is a <i>multitool</i> of a product.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/cyicKWH3ZiZNtQmjNSGEi/2f7fbea400ccc34e9d4996c999fa5980/image3-33.png" />
            
            </figure><p>Photo by <a href="https://unsplash.com/@zelebb?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Andrey Matveev</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></p><p>Like multitools and other generalist products, Page Rules does a good job at many things, but is not best-of-breed at anything. This is the trade-off of generalism. As we have grown as a company our customers have rightfully demanded more. Filtering on URL-alone is no longer sufficient; users are demanding more - and today we are delivering.</p><p>Over the last two years we have been working on the future of Page Rules and distilling hundreds of pieces of feedback into common themes, such as:</p><ol><li><p>I need more than 125 Page Rules</p></li><li><p>I need to be able to trigger Page Rules on more than just the URL</p></li><li><p>I need to be able to use regular expressions in my Page Rules</p></li><li><p>It's hard for me to understand how different Page Rules interact one another</p></li><li><p>Page Rules is hard to debug</p></li><li><p>I want more actions in Page Rules</p></li></ol><p>Analyzing these themes we came to the conclusion that the best thing for Page Rules was to disassemble it and create new discrete products, each of which could be best-of-breed for their relevant areas. This dissolution would also provide better clarity regarding interoperation (cache vs configuration vs …), and make debugging simpler.</p><p>Today, we announce those new products:</p><p><b>1. Cache</b> <b>Rules</b>: A dedicated product for setting and tuning ‘everything caching’.</p><p><b>2. Configuration</b> <b>Rules</b>: A dedicated product for setting and selectively enabling, disabling and overriding zone-wide settings.</p><p><b>3. Dynamic</b> <b>Redirects</b>: Like ‘Forwarding URL’ but turned up to 11. Redirect based on the visitors country, their preferred language, their device type, use regular expressions (plan level dependant) and more.</p><p><b>4. Origin</b> <b>Rules</b>: A dedicated product for ‘where does this traffic go where it leaves Cloudflare’. Not only have we added host header and resolve override into this new product (ENT only), we’ve also productized another common Workers use case by enabling customers to selectively override the destination port. We’ve also added the ability to override the Server Name Indication (SNI).</p><p>All four of these products are available for use now via the dashboard, API and Terraform - and sitting alongside Transform Rules provide the replacement suite of products that will eventually enable an Page Rules end-of-life announcement.</p><p>We have dedicated blogs for each of these product launches with more information on what they offer and problems they address.</p>
    <div>
      <h3>Order of execution</h3>
      <a href="#order-of-execution">
        
      </a>
    </div>
    <p>One of the main benefits of this new product suite is clarity.</p><p>Page Rules is a black box, where traffic goes in, ‘things happen’, and traffic comes out. It's hard to debug the interplay between cache, configuration, header modification etc and it can vary from zone to zone as it's entirely user defined.</p><p>By having discrete, separate areas per ‘function’, it makes visualizing the flow of a HTTP request much easier:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/WNh8WO5B7n3AeI9oczS8I/01e83a7564af29aa0014de69ff245de9/image1-58.png" />
            
            </figure><p>Rather than a single lozenge of Page Rules, we now have visibility that Origin Rules will run first, then Cache Rules, then Configuration Rules, and finally Dynamic Redirects. This means we will modify host headers first, before tuning cache settings. And we will tune the cache parameters before we modify which settings are enabled for the specific traffic.</p><p>We have integrated these new products into the <a href="/traffic-sequence-which-product-runs-first/">Traffic Sequence</a> dashboard element also.</p><p>(For zones using both Page Rules and this new suite of products: The new products will take precedence over Page Rules. This means that Page Rules will be overridden if a conflict occurs).</p>
    <div>
      <h3>I need more than 125 Page Rules</h3>
      <a href="#i-need-more-than-125-page-rules">
        
      </a>
    </div>
    <p>One of the limitations of Page Rules was how each Page Rule was stored and executed on our backend architecture. We are unable to offer more than 125 Page Rules per zone before we begin to see a performance hit - latency on HTTP requests begins to increase as evaluating them vs the Page Rules takes longer and longer. To combat this limitation users moved simple workloads to Workers, or split the zone into multiple sub domains, each with a 125 Page Rules quota. Neither of these are ideal for the customer.</p><p>To combat this limitation we have built <i>all</i> of the replacement products atop our lightning-fast <a href="https://developers.cloudflare.com/ruleset-engine/about/rulesets/">Rulesets Engine</a>, which also runs products such as Transform Rules, Custom Rules (WAF), Bulk Redirects and API Shield.</p><p>This allows us to offer much more quota to customers, as this engine is built to scale well beyond 125 rules per product. The table below summarizes the before and after impact of these new products, showing the default rules quota per plan:</p><table>
<thead>
  <tr>
    <th>Plan</th>
    <th>Page Rules</th>
    <th>Origin Rules</th>
    <th>Cache Rules</th>
    <th>Config Rules</th>
    <th>Dynamic Redirects</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>Enterprise</td>
    <td>125</td>
    <td>125+</td>
    <td>125+</td>
    <td>125+</td>
    <td>125+</td>
  </tr>
  <tr>
    <td>Business</td>
    <td>50</td>
    <td>50</td>
    <td>50</td>
    <td>50</td>
    <td>50</td>
  </tr>
  <tr>
    <td>Pro</td>
    <td>20</td>
    <td>25</td>
    <td>25</td>
    <td>25</td>
    <td>25</td>
  </tr>
  <tr>
    <td>Free</td>
    <td>3</td>
    <td>10</td>
    <td>10</td>
    <td>10</td>
    <td>10</td>
  </tr>
</tbody>
</table><p><i>Additional rules cannot be purchased for these new products.</i></p><p>This means zone’s on the Enterprise plan now have a minimum of <b>500</b> rules to use where before they had 125 via Page Rules. For Enterprises the quota for the new products is negotiable. Pro plan zones go from 20 Page Rules to 100.  Combined with the fine-grained control that the ruleset engine offers, these changes allow customers to customize their zone’s traffic to the finest of margins.</p><p>The other benefit from building all of these products on the Rulesets Engine is extensibility. Currently there are over 30 products that are built and running on the Rulesets Engine. Each of these products is essentially a logical bucket called a ‘phase’ which contains a single ruleset scoped to that product. Each phase is restricted to specific actions and fields, for example the field cf.bot_management.score is unavailable in http_request_transform as we have not calculated the bot score at the time we perform URL rewrites. Also, only the <code>rewrite</code> action is permitted. Whereas in Origin Rules (http_request_origin) we only allow the action <code>route</code></p><p>When we create new capabilities for a product that is built atop the Rulesets Engine it is trivially simple for us to extend that new capability to other products at a later date.</p><p>For example, we added a new <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/fields">‘field’</a>, <code>http.request.accepted_languages</code> to Transform Rules earlier in the year. Until recently this was only available in Transform Rules. However, as both products are built on the <a href="https://developers.cloudflare.com/ruleset-engine/about/rulesets/">Rulesets Engine</a> it was trivial to enable this feature for Dynamic Redirects. This allows customers to perform URL redirects based on the visitor's language preference, and the cost to us from an engineering perspective is negligible as the field is already implemented.</p><p>This also means in the future should a new field be created for Cache Rules due to a customer request, e.g. http.request.super_cool_field, in a matter of clicks we can enable this field for any of the other 30 products rather than have to duplicate effort across multiple platforms.</p><p>Simply put, the more products we build on top of the Rulesets Engine, the faster we can move and the more functionality we can put into users hands.</p>
    <div>
      <h3>A single user experience</h3>
      <a href="#a-single-user-experience">
        
      </a>
    </div>
    <p>The most important benefit of all is consistency. Each of these products has a consistent and predictable API. A consistent and predictable Terraform configuration, and a consistent and predictable user experience in the dashboard. The ruleset engine allows us to keep everything the same except for the ‘action’. The filtering stays the same, the API stays the same, the UI stays (largely) the same, the only change is the ‘…then’, the action section of the rule.</p><p>This ensures that as a user when you are clicking around the dashboard setting up a new zone you aren't having to learn each individual product’s page and how to navigate it. The only part you need to learn is what makes that product unique, its <i>actions</i>:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6hfXLnp7HiV9sziDFJl9zw/cf888d5c543db9380d81398bb60b46c2/image4-15.png" />
            
            </figure><p>Finally, when we add a new product, extending the Terraform provider to support it is trivial. That consistent experience has been a north star for us during this project and will continue to be in the future.</p>
    <div>
      <h3>Try it them now</h3>
      <a href="#try-it-them-now">
        
      </a>
    </div>
    <p>We are replacing Page Rules with a new suite of products, each built to be best-of-breed and put more power into the hands of our users.</p><p>Read more about the new products in each of their dedicated blogs. Then, <a href="https://dash.cloudflare.com/?to=/:account/:zone/rules/">try</a> them for yourself!</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Page Rules]]></category>
            <category><![CDATA[Origin Rules]]></category>
            <category><![CDATA[Cache Rules]]></category>
            <category><![CDATA[Config Rules]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">1udqPnVLDWQhuQf9MtMyt2</guid>
            <dc:creator>Sam Marsh</dc:creator>
        </item>
    </channel>
</rss>