
<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>Fri, 03 Apr 2026 17:02:24 GMT</lastBuildDate>
        <item>
            <title><![CDATA[How Cloudflare uses the world’s greatest collection of performance data to make the world’s fastest global network even faster]]></title>
            <link>https://blog.cloudflare.com/how-cloudflare-uses-the-worlds-greatest-collection-of-performance-data/</link>
            <pubDate>Fri, 26 Sep 2025 06:00:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare is using its vast traffic to send responses faster than ever before, by learning the characteristics of each individual network and tuning our congestion control system.    ]]></description>
            <content:encoded><![CDATA[ <p>Cloudflare operates the fastest network on the planet. <a href="https://blog.cloudflare.com/20-percent-internet-upgrade"><u>We’ve shared an update today</u></a> about how we are overhauling the software technology that accelerates every server in our fleet, improving speed globally.</p><p>That is not where the work stops, though. To improve speed even further, we have to also make sure that our network swiftly handles the Internet-scale congestion that hits it every day, routing traffic to our now-faster servers.</p><p>We have invested in congestion control for years. Today, we are excited to share how we are applying a superpower of our network, our massive Free Plan user base, to optimize performance and find the best way to route traffic across our network for all our customers globally.</p><p>Early results have seen performance increases that average 10% faster than the prior baseline. We achieved this by applying different algorithmic methods to improve performance based on the data we observe about the Internet each day. We are excited to begin rolling out these improvements to all customers.</p>
    <div>
      <h3>How does traffic arrive in our network?</h3>
      <a href="#how-does-traffic-arrive-in-our-network">
        
      </a>
    </div>
    <p>The Internet is a massive collection of interconnected networks, each composed of many machines (“nodes”). Data is transmitted by breaking it up into small packets, and passing them from one machine to another (over a “link”). Each one of these machines is linked to many others, and each link has limited capacity.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7fTvUVuusvuivy20i1ikSm/4a46cfc5bf3263a8712a52ed3b207af6/image5.png" />
          </figure><p>When we send a packet over the Internet, it will travel in a series of “hops” over the links from A to B.  At any given time, there will be one link (one “hop”) with the least available capacity for that path. It doesn’t matter where in the connection this hop is — it will be the bottleneck.</p><p>But there’s a challenge — when you’re sending data over the Internet, you don’t know what route it’s going to take. In fact, each node decides for itself which route to send the traffic through, and different packets going from A to B can take entirely different routes. The dynamic and decentralized nature of the system is what makes the Internet so effective, but it also makes it very hard to work out how much data can be sent.  So — how can a sender know where the bottleneck is, and how fast to send data?</p><p>Between Cloudflare nodes, our <a href="https://developers.cloudflare.com/argo-smart-routing/"><u>Argo Smart Routing</u></a> product takes advantage of our visibility into the global network to speed up communication. Similarly, when we initiate connections to customer origins, we can leverage Argo and other insights to optimize them. However, the speed of a connection from your phone or laptop (the Client below) to the nearest Cloudflare datacenter will depend on the capacity of the bottleneck hop in the chain from you to Cloudflare, which happens outside our network.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6ca9pXZUfgCIlCyi5LMikk/220154f58f8dbfbfb45b49db4f068dc9/image2.png" />
          </figure>
    <div>
      <h3>What happens when too much data arrives at once?</h3>
      <a href="#what-happens-when-too-much-data-arrives-at-once">
        
      </a>
    </div>
    <p>If too much data arrives at any one node in a network in the path of a request being processed, the requestor will experience delays due to congestion. The data will either be queued for a while (risking <a href="https://en.wikipedia.org/wiki/Bufferbloat"><u>bufferbloat</u></a>), or some of it will simply get dropped. Protocols like TCP and QUIC respond to packets being dropped by retransmitting the data, but this introduces a delay, and can even make the problem worse by further overloading the limited capacity.</p><p>If cloud infrastructure providers like Cloudflare don’t manage congestion carefully, we risk overloading the system, slowing down the rate of data getting through. This actually <a href="https://en.wikipedia.org/wiki/Network_congestion#Congestive_collapse"><u>happened in the early days of the Internet</u></a>. To avoid this, the Internet infrastructure community has developed systems for controlling congestion, which give everyone a turn to send their data, without overloading the network. This is an evolving challenge, as the network grows ever more complicated, and the best method to implement congestion control is a constant pursuit. Many different algorithms have been developed, which take different sources of information and signals, optimize in a particular method, and respond to congestion in different ways.</p><p>Congestion control algorithms use a number of signals to estimate the right rate to send traffic, without knowing how the network is set up. One important signal has been <b>loss</b>. When a packet is received, the receiver sends an “ACK,” telling the sender the packet got through. If it’s dropped somewhere along the way, the sender never gets the receipt, and after a timeout will treat the packet as having been lost.</p><p>More recent algorithms have used additional data. For example, a popular algorithm called <a href="https://blog.cloudflare.com/http-2-prioritization-with-nginx/#bbr-congestion-control"><u>BBR (Bottleneck Bandwidth and Round-trip propagation time)</u></a>, which we have been using for much of our traffic, attempts to build a model during each connection of the maximum amount of data that can be transmitted in a given time period, using estimates of the round trip time as well as loss information.</p><p>The best algorithm to use often depends on the workload. For example, for interactive traffic like a video call, an algorithm that biases towards sending too much traffic can cause queues to build up, leading to high latency and poor video experience. If one were to optimize solely for that use case though, and avoid that by sending less traffic, the network will not make the best use of the connection for clients doing bulk downloads. The performance optimization outcome varies, depending on a lot of different factors.  But – we have visibility into many of them!</p><p>BBR was an exciting development in congestion control approach, moving from reactive loss-based approaches to proactive model-based optimization, resulting in significantly better performance for modern networks. Our data gives us an opportunity to go further, applying different algorithmic methods to improve performance. </p>
    <div>
      <h3>How can we do better?</h3>
      <a href="#how-can-we-do-better">
        
      </a>
    </div>
    <p>All the existing algorithms are constrained to use only information gathered during the lifetime of the current connection. Thankfully, we know far more about the Internet at any given moment than this!  With Cloudflare’s perspective on traffic, we see much more than any one customer or ISP might see at any given time.</p><p>Every day, we see traffic from essentially every major network on the planet. When a request comes into our system, we know what client device we’re talking to, what type of network is enabling the connection, and whether we’re talking to consumer ISPs or cloud infrastructure providers.</p><p>We know about the patterns of load across the global Internet, and the locations where we believe systems are overloaded, within our network, or externally. We know about the networks that have stable properties, which have high packet loss due to cellular data connections, and the ones that traverse low earth orbit satellite links and radically change their routes every 15 seconds. </p>
    <div>
      <h3>How does this work?</h3>
      <a href="#how-does-this-work">
        
      </a>
    </div>
    <p>We have been in the process of migrating our network technology stack to use a new platform, powered by Rust, that provides more flexibility to experiment with varying the parameters in the algorithms used to handle congestion control. Then we needed data.</p><p>The data powering these experiments needs to reflect the measure we’re trying to optimize, which is the user experience. It’s not just enough that we’re sending data to nearly all the networks on the planet; we have to be able to see what is the experience that customers have. So how do we do that, at our scale?</p><p>First, we have detailed “passive” logs of the rate at which data is able to be sent from our network, and how long it takes for the destination to acknowledge receipt. This covers all our traffic, and gives us an idea of how quickly the data was received by the client, but doesn’t guarantee to tell us about the user experience.</p><p>Next, we have a system for gathering <a href="https://developers.cloudflare.com/speed/observatory/rum-beacon/"><u>Real User Measurement</u></a> (RUM) data, which records information in supported web browsers about metrics such as Page Load Time (PLT). Any Cloudflare customer can enable this and will receive detailed insights in their dashboard. In addition, we use this metadata in aggregate across all our customers and networks to understand what customers are really experiencing. </p><p>However, RUM data is only going to be present for a small proportion of connections across our network. So, we’ve been working to find a way to predict the RUM measures by extrapolating from the data we see only in passive logs. For example, here are the results of an experiment we performed comparing two different algorithms against the cubic baseline.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/u3C9Otkgf46yMcc2gGQTe/adde0c39d62f2fb6c88b439d826e8f4a/image4.png" />
          </figure><p>Now, here’s the same timescale, observed through the prediction based on our passive logs. The curves are very similar - but even more importantly, the ratio between the curves is very similar. <b>This is huge!</b> We can use a relatively small amount of RUM data to validate our findings, but optimize our network in a much more fine-grained way by using the full firehose of our passive logs.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3ExUljHIAUBxFiUuFccRtY/6db8fa8d3d388f484b6ac7f71eeab83f/image3.png" />
          </figure><p>Extrapolating too far becomes unreliable, so we’re also working with some of our largest customers to improve our visibility of the behaviour of the network from their clients’ point of view, which allows us to extend this predictive model even further. In return, we’ll be able to give our customers insights into the true experience of their clients, in a way that no other platform can offer.</p>
    <div>
      <h3>What is next?</h3>
      <a href="#what-is-next">
        
      </a>
    </div>
    <p>We’re currently running our experiments and improved algorithms for congestion control on all of our free tier QUIC traffic. As we learn more, verify on more complex customers, and expand to TCP traffic, we’ll gradually roll this out to all our customers, for all traffic, over 2026 and beyond. The results have led to as much as a 10% improvement as compared to the baseline!</p><p>We’re working with a select group of enterprises to test this in an early access program. If you’re interested in learning more, <a href="https://forms.gle/MCBjEEhYQvwWFccx9"><u>contact us</u></a>! </p> ]]></content:encoded>
            <category><![CDATA[Speed]]></category>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">18yRAwafvLrtG4qnJbMd3P</guid>
            <dc:creator>Steve Goldsmith</dc:creator>
            <dc:creator>Richard Boulton</dc:creator>
        </item>
        <item>
            <title><![CDATA[“You get Instant Purge, and you get Instant Purge!” — all purge methods now available to all customers]]></title>
            <link>https://blog.cloudflare.com/instant-purge-for-all/</link>
            <pubDate>Tue, 01 Apr 2025 14:00:00 GMT</pubDate>
            <description><![CDATA[ Following up on having the fastest purge in the industry, we have now increased Instant Purge quotas across all Cloudflare plans.  ]]></description>
            <content:encoded><![CDATA[ <p>There's a tradition at Cloudflare of launching real products on April 1, instead of the usual joke product announcements circulating online today. In previous years, we've introduced impactful products like <a href="https://blog.cloudflare.com/announcing-1111/"><u>1.1.1.1</u></a> and <a href="https://blog.cloudflare.com/introducing-1-1-1-1-for-families/"><u>1.1.1.1 for Families</u></a>. Today, we're excited to continue this tradition by <b>making every purge method available to all customers, regardless of plan type.</b></p><p>During Birthday Week 2024, we <a href="https://blog.cloudflare.com/instant-purge/"><u>announced our intention</u></a> to bring the full suite of purge methods — including purge by URL, purge by hostname, purge by tag, purge by prefix, and purge everything — to all Cloudflare plans. Historically, methods other than "purge by URL" and "purge everything" were exclusive to Enterprise customers. However, we've been openly rebuilding our purge pipeline over the past few years (hopefully you’ve read <a href="https://blog.cloudflare.com/part1-coreless-purge/"><u>some of our</u></a> <a href="https://blog.cloudflare.com/rethinking-cache-purge-architecture/"><u>blog</u></a> <a href="https://blog.cloudflare.com/instant-purge/"><u>series</u></a>), and we're thrilled to share the results more broadly. We've spent recent months ensuring the new Instant Purge pipeline performs consistently under 150 ms, even during increased load scenarios, making it ready for every customer.  </p><p>But that's not all — we're also significantly raising the default purge rate limits for Enterprise customers, allowing even greater purge throughput thanks to the efficiency of our newly developed <a href="https://blog.cloudflare.com/instant-purge/"><u>Instant Purge</u></a> system.</p>
    <div>
      <h2>Building a better purge: a two-year journey</h2>
      <a href="#building-a-better-purge-a-two-year-journey">
        
      </a>
    </div>
    <p>Stepping back, today's announcement represents roughly two years of focused engineering. Near the end of 2022, our team went heads down rebuilding Cloudflare’s purge pipeline with a clear yet challenging goal: dramatically increase our throughput while maintaining near-instant invalidation across our global network.</p><p>Cloudflare operates <a href="https://www.cloudflare.com/network"><u>data centers in over 335 cities worldwide</u></a>. Popular cached assets can reside across all of our data centers, meaning each purge request must quickly propagate to every location caching that content. Upon receiving a purge command, each data center must efficiently locate and invalidate cached content, preventing stale responses from being served. The amount of content that must be invalidated can vary drastically, from a single file, to all cached assets associated with a particular hostname. After the content has been purged, any subsequent requests will trigger retrieval of a fresh copy from the origin server, which will be stored in Cloudflare’s cache during the response. </p><p>Ensuring consistent, rapid propagation of purge requests across a vast network introduces substantial technical challenges, especially when accounting for occasional data center outages, maintenance, or network interruptions. Maintaining consistency under these conditions requires robust distributed systems engineering.</p>
    <div>
      <h2>How did we scale purge?</h2>
      <a href="#how-did-we-scale-purge">
        
      </a>
    </div>
    <p>We've <a href="https://blog.cloudflare.com/instant-purge/"><u>previously discussed</u></a> how our new Instant Purge system was architected to achieve sub-150 ms purge times. It’s worth noting that the performance improvements were only part of what our new architecture achieved, as it also helped us solve significant scaling challenges around storage and throughput that allowed us to bring Instant Purge to all users. </p><p>Initially, our purge system scaled well, but with rapid customer growth, the storage consumption from millions of daily purge keys that needed to be stored reduced available caching space. Early attempts to manage this storage and throughput demand involved <a href="https://www.boltic.io/blog/kafka-queue"><u>queues</u></a> and batching for smoothing traffic spikes, but this introduced latency and underscored the tight coupling between increased usage and rising storage costs.</p><p>We needed to revisit our thinking on how to better store purge keys and when to remove purged content so we could reclaim space. Historically, when a customer would purge by tag, prefix or hostname, Cloudflare would mark the content as expired and allow it to be evicted later. This is known as lazy-purge because nothing is actively removed from disk. Lazy-purge is fast, but not necessarily efficient, because it consumes storage for expired but not-yet-evicted content. After examining global or data center-level indexing for purge keys, we decided that wasn't viable due to increases in system complexity and the latency those indices could bring due to our network size. So instead, we opted for per-machine indexing, integrating indices directly alongside our cache proxies. This minimized network complexity, simplified reliability, and provided predictable scaling.</p><p>After careful analysis and benchmarking, we selected <a href="https://rocksdb.org/"><u>RocksDB</u></a>, an embedded key-value store that we could optimize for our needs, which formed the basis of <a href="https://blog.cloudflare.com/instant-purge/#putting-it-all-together"><u>CacheDB</u></a>, our Rust-based service running alongside each cache proxy. CacheDB manages indexing and immediate purge execution (active purge), significantly reducing storage needs and freeing space for caching.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4FZ0bQSx5MUhx3x3hwlRuk/91a27af7db5e629cd6d5fbe692397eaf/image2.png" />
          </figure><p>Local queues within CacheDB buffer purge operations to ensure consistent throughput without latency spikes, while the cache proxies consult CacheDB to guarantee rapid, active purges. Our updated distribution pipeline broadcasts purges directly to CacheDB instances across machines, dramatically improving throughput and purge speed.</p><p>Using CacheDB, we've reduced storage requirements 10x by eliminating lazy purge storage accumulation, instantly freeing valuable disk space. The freed storage enhances cache retention, boosting cache HIT ratios and minimizing origin egress. These savings in storage and increased throughput allowed us to scale to the point where we can offer Instant Purge to more customers.</p><p>For more information on how we designed the new Instant Purge system, please see the previous <a href="https://blog.cloudflare.com/instant-purge/"><u>installment</u></a> of our Purge series blog posts. </p>
    <div>
      <h2>Striking the right balance: what to purge and when</h2>
      <a href="#striking-the-right-balance-what-to-purge-and-when">
        
      </a>
    </div>
    <p>Moving on to practical considerations of using these new purge methods, it’s important to use the right method for what you want to invalidate. Purging too aggressively can overwhelm origin servers with unnecessary requests, driving up egress costs and potentially causing downtime. Conversely, insufficient purging leaves visitors with outdated content. Balancing precision and speed is vital.</p><p>Cloudflare supports multiple targeted purge methods to help customers achieve this balance.</p><ul><li><p><a href="https://developers.cloudflare.com/cache/how-to/purge-cache/purge-everything/"><b><u>Purge Everything</u></b></a>: Clears all cached content associated with a website.</p></li><li><p><a href="https://developers.cloudflare.com/cache/how-to/purge-cache/purge_by_prefix/"><b><u>Purge by Prefix</u></b></a>: Targets URLs sharing a common prefix.</p></li><li><p><a href="https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-hostname/"><b><u>Purge by Hostname</u></b></a>: Invalidates content by specific hostnames.</p></li><li><p><a href="https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-single-file/"><b><u>Purge by URL (single-file purge</u></b></a><b>)</b>: Precisely targets individual URLs.</p></li><li><p><a href="https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-tags/"><b><u>Purge by Tag</u></b></a>: Uses <a href="https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-tags/#add-cache-tag-http-response-headers"><u>Cache-Tag</u></a> headers to invalidate grouped assets, offering flexibility for complex cache management scenarios.</p></li></ul><p>Starting today, all of these methods are available to every Cloudflare customer.    </p>
    <div>
      <h2>How to purge </h2>
      <a href="#how-to-purge">
        
      </a>
    </div>
    <p>Users can select their purge method directly in the Cloudflare dashboard, located under the Cache tab in the <a href="https://dash.cloudflare.com/?to=/:account/:zone/caching/configuration"><u>configurations section</u></a>, or via the <a href="https://developers.cloudflare.com/api/resources/cache/"><u>Cloudflare API</u></a>. Each purge request should clearly specify the targeted URLs, hostnames, prefixes, or cache tags relevant to the selected purge type (known as purge keys). For instance, a prefix purge request might specify a directory such as example.com/foo/bar. To maximize efficiency and throughput, batching multiple purge keys in a single request is recommended over sending individual purge requests each with a single key.</p>
    <div>
      <h2>How much can you purge?</h2>
      <a href="#how-much-can-you-purge">
        
      </a>
    </div>
    <p>The new rate limits for Cloudflare's purge by tag, prefix, hostname, and purge everything are different for each plan type. We use a <a href="https://en.wikipedia.org/wiki/Token_bucket"><u>token bucket</u></a> rate limit system, so each account has a token bucket with a maximum size based on plan type. When we receive a purge request we first add tokens to the account’s bucket based on the time passed since the account’s last purge request divided by the refill rate for its plan type (which can be a fraction of a token). Then we check if there’s at least one whole token in the bucket, and if so we remove it and process the purge request. If not, the purge request will be rate limited. An easy way to think about this rate limit is that the refill rate represents the consistent rate of requests a user can send in a given period while the bucket size represents the maximum burst of requests available.</p><p>For example, a free user starts with a bucket size of 25 requests and a refill rate of 5 requests per minute (one request per 12 seconds). If the user were to send 26 requests all at once, the first 25 would be processed, but the last request would be rate limited. They would need to wait 12 seconds and retry their last request for it to succeed. </p><p>The current limits are applied per <b>account</b>: </p><table><tr><td><p><b>Plan</b></p></td><td><p><b>Bucket size</b></p></td><td><p><b>Request refill rate</b></p></td><td><p><b>Max keys per request</b></p></td><td><p><b>Total keys</b></p></td></tr><tr><td><p><b>Free</b></p></td><td><p>25 requests</p></td><td><p>5 per minute</p></td><td><p>100</p></td><td><p>500 per minute</p></td></tr><tr><td><p><b>Pro</b></p></td><td><p>25 requests</p></td><td><p>5 per second</p></td><td><p>100</p></td><td><p>500 per second</p></td></tr><tr><td><p><b>Biz</b></p></td><td><p>50 requests</p></td><td><p>10 per second</p></td><td><p>100</p></td><td><p>1,000 per second</p></td></tr><tr><td><p><b>Enterprise</b></p></td><td><p>500 requests</p></td><td><p>50 per second</p></td><td><p>100</p></td><td><p>5,000 per second</p></td></tr></table><p>More detailed documentation on all purge rate limits can be found in our <a href="https://developers.cloudflare.com/cache/how-to/purge-cache/"><u>documentation</u></a>.</p>
    <div>
      <h2>What’s next?</h2>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>We’ve spent a lot of time optimizing our purge platform. But we’re not done yet. Looking forward, we will continue to enhance the performance of Cloudflare’s single-file purge. The current P50 performance is around 250 ms, and we suspect that we can optimize it further to bring it under 200 ms. We will also build out our ability to allow for greater purge throughput for all of our systems, and will continue to find ways to implement filtering techniques to ensure we can continue to scale effectively and allow customers to purge whatever and whenever they choose. </p><p>We invite you to try out our new purge system today and deliver an instant, seamless experience to your visitors.</p> ]]></content:encoded>
            <category><![CDATA[Cache]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Performance]]></category>
            <category><![CDATA[Cache Purge]]></category>
            <guid isPermaLink="false">4LTq8Utw6K58W4ojKxsqw8</guid>
            <dc:creator>Alex Krivit</dc:creator>
            <dc:creator> Connor Harwood</dc:creator>
            <dc:creator>Zaidoon Abd Al Hadi</dc:creator>
        </item>
        <item>
            <title><![CDATA[Improving platform resilience at Cloudflare through automation]]></title>
            <link>https://blog.cloudflare.com/improving-platform-resilience-at-cloudflare/</link>
            <pubDate>Wed, 09 Oct 2024 13:00:00 GMT</pubDate>
            <description><![CDATA[ We realized that we need a way to automatically heal our platform from an operations perspective, and designed and built a workflow orchestration platform to provide these self-healing capabilities   ]]></description>
            <content:encoded><![CDATA[ <p>Failure is an expected state in production systems, and no predictable failure of either software or hardware components should result in a negative experience for users. The exact failure mode may vary, but certain remediation steps must be taken after detection. A common example is when an error occurs on a server, rendering it unfit for production workloads, and requiring action to recover.</p><p>When operating at Cloudflare’s scale, it is important to ensure that our platform is able to recover from faults seamlessly. It can be tempting to rely on the expertise of world-class engineers to remediate these faults, but this would be manual, repetitive, unlikely to produce enduring value, and not scaling. In one word: toil; not a viable solution at our scale and rate of growth.</p><p>In this post we discuss how we built the foundations to enable a more scalable future, and what problems it has immediately allowed us to solve.</p>
    <div>
      <h2>Growing pains</h2>
      <a href="#growing-pains">
        
      </a>
    </div>
    <p>The Cloudflare <a href="https://en.wikipedia.org/wiki/Site_reliability_engineering"><u>Site Reliability Engineering (SRE)</u></a> team builds and manages the platform that helps product teams deliver our extensive suite of offerings to customers. One important component of this platform is the collection of servers that power critical products such as Durable Objects, Workers, and DDoS mitigation. We also build and maintain foundational software services that power our product offerings, such as configuration management, provisioning, and IP address allocation systems.</p><p>As part of tactical operations work, we are often required to respond to failures in any of these components to minimize impact to users. Impact can vary from lack of access to a specific product feature, to total unavailability. The level of response required is determined by the priority, which is usually a reflection of the severity of impact on users. Lower-priority failures are more common — a server may run too hot, or experience an unrecoverable hardware error. Higher-priority failures are rare and are typically resolved via a well-defined incident response process, requiring collaboration with multiple other teams.</p><p>The commonality of lower-priority failures makes it obvious when the response required, as defined in runbooks, is “toilsome”. To reduce this toil, we had previously implemented a plethora of solutions to automate runbook actions such as manually-invoked shell scripts, cron jobs, and ad-hoc software services. These had grown organically over time and provided solutions on a case-by-case basis, which led to duplication of work, tight coupling, and lack of context awareness across the solutions.</p><p>We also care about how long it takes to resolve any potential impact on users. A resolution process which involves the manual invocation of a script relies on human action, increasing the Mean-Time-To-Resolve (MTTR) and leaving room for human error. This risks increasing the amount of errors we serve to users and degrading trust.</p><p>These problems proved that we needed a way to automatically heal these platform components. This especially applies to our servers, for which failure can cause impact across multiple product offerings. While we have <a href="https://blog.cloudflare.com/unimog-cloudflares-edge-load-balancer"><u>mechanisms to automatically steer traffic away</u></a> from these degraded servers, in some rare cases the breakage is sudden enough to be visible.</p>
    <div>
      <h2>Solving the problem</h2>
      <a href="#solving-the-problem">
        
      </a>
    </div>
    <p>To provide a more reliable platform, we needed a new component that provides a common ground for remediation efforts. This would remove duplication of work, provide unified context-awareness and increase development speed, which ultimately saves hours of engineering time and effort.</p><p>A good solution would not allow only the SRE team to auto-remediate, it would empower the entire company. The key to adding self-healing capability was a generic interface for all teams to self-service and quickly remediate failures at various levels: machine, service, network, or dependencies.</p><p>A good way to think about auto-remediation is in terms of workflows. A workflow is a sequence of steps to get to a desired outcome. This is not dissimilar to a manual shell script which executes what a human would otherwise do via runbook instructions. Because of this logical fit with workflows and durable execution, we decided to adopt an open-source platform called <a href="https://github.com/temporalio/temporal"><u>Temporal</u></a>. </p><p>The concept of durable execution is useful to gracefully manage infrastructure failures such as network outages and transient failures in external service endpoints. This capability meant we only needed to build a way to schedule “workflow” tasks and have the code provide reliability guarantees by default, using Temporal. This allowed us to focus on building out the orchestration system to support the control and flow of workflow execution in our data centers. </p><p><a href="https://learn.temporal.io/getting_started/go/first_program_in_go/"><u>Temporal’s documentation</u></a> provides a good introduction to writing Temporal workflows.</p>
    <div>
      <h2>Building an Automatic Remediation System</h2>
      <a href="#building-an-automatic-remediation-system">
        
      </a>
    </div>
    <p>Below, we describe how our automatic remediation system works. It is essentially a way to schedule tasks across our global network with built-in reliability guarantees. With this system, teams can serve their customers more reliably. An unexpected failure mode can be recognized and immediately mitigated, while the root cause can be determined later via a more detailed analysis.</p>
    <div>
      <h3>Step one: we need a coordinator</h3>
      <a href="#step-one-we-need-a-coordinator">
        
      </a>
    </div>
    
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/FOpkEE13QcgwHJ9vhcIZj/5b0c5328ee5326794329a4a07c5db065/Building_on_Temporal_process.png" />
          </figure><p>After our initial testing of Temporal, it was now possible to write workflows. But we needed a way to schedule workflow tasks from other internal services. The coordinator was built to serve this purpose, and became the primary mechanism for the authorisation and scheduling of workflows. </p><p>The most important roles of the coordinator are authorisation, workflow task routing, and safety constraints enforcement. Each consumer is authorized via <a href="https://www.cloudflare.com/learning/access-management/what-is-mutual-tls/"><u>mTLS authentication</u></a>, and the coordinator uses an ACL to determine whether to permit the execution of a workflow. An ACL configuration looks like the following example.</p>
            <pre><code>server_config {
    enable_tls = true
    [...]
    route_rule {
      name  = "global_get"
      method = "GET"
      route_patterns = ["/*"]
      uris = ["spiffe://example.com/worker-admin"]
    }
    route_rule {
      name = "global_post"
      method = "POST"
      route_patterns = ["/*"]
      uris = ["spiffe://example.com/worker-admin"]
      allow_public = true
    }
    route_rule {
      name = "public_access"
      method = "GET"
      route_patterns = ["/metrics"]
      uris = []
      allow_public = true
      skip_log_match = true
    }
}
</code></pre>
            <p>Each workflow specifies two key characteristics: where to run the tasks and the safety constraints, using an <a href="https://github.com/hashicorp/hcl"><u>HCL</u></a> configuration file. Example constraints could be whether to run on only a specific node type (such as a database), or if multiple parallel executions are allowed: if a task has been triggered too many times, that is a sign of a wider problem that might require human intervention. The coordinator uses the Temporal <a href="https://docs.temporal.io/visibility"><u>Visibility API</u></a> to determine the current state of the executions in the Temporal cluster.</p><p>An example of a configuration file is shown below:</p>
            <pre><code>task_queue_target = "&lt;target&gt;"

# The following entries will ensure that
# 1. This workflow is not run at the same time in a 15m window.
# 2. This workflow will not run more than once an hour.
# 3. This workflow will not run more than 3 times in one day.
#
constraint {
    kind = "concurency"
    value = "1"
    period = "15m"
}

constraint {
    kind = "maxExecution"
    value = "1"
    period = "1h"
}

constraint {
    kind = "maxExecution"
    value = "3"
    period = "24h"
    is_global = true
}
</code></pre>
            
    <div>
      <h3>Step two: Task Routing is amazing</h3>
      <a href="#step-two-task-routing-is-amazing">
        
      </a>
    </div>
    
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4wOIwKfkKzp7k46Z6tPuhW/f35667a65872cf7a90fc9c03f38a48d5/Task_Routing_is_amazing_process.png" />
          </figure><p>An unforeseen benefit of using a central Temporal cluster was the discovery of Task Routing. This feature allows us to schedule a Workflow/Activity on any server that has a running Temporal Worker, and further segment by the type of server, its location, etc. For this reason, we have three primary task queues — the general queue in which tasks can be executed by any worker in the datacenter, the node type queue in which tasks can only be executed by a specific node type in the datacenter, and the individual node queue where we target a specific node for task execution.</p><p>We rely on this heavily to ensure the speed and efficiency of automated remediation. Certain tasks can be run in datacenters with known low latency to an external resource, or a node type with better performance than others (due to differences in the underlying hardware). This reduces the amount of failure and latency we see overall in task executions. Sometimes we are also constrained by certain types of tasks that can only run on a certain node type, such as a database.</p><p>Task Routing also means that we can configure certain task queues to have a higher priority for execution, although this is not a feature we have needed so far. A drawback of task routing is that every Workflow/Activity needs to be registered to the target task queue, which is a common gotcha. Thankfully, it is possible to catch this failure condition with proper testing.</p>
    <div>
      <h3>Step three: when/how to self-heal?</h3>
      <a href="#step-three-when-how-to-self-heal">
        
      </a>
    </div>
    <p>None of this would be relevant if we didn’t put it to good use. A primary design goal for the platform was to ensure we had easy, quick ways to trigger workflows on the most important failure conditions. The next step was to determine what the best sources to trigger the actions were. The answer to this was simple: we could trigger workflows from anywhere as long as they are properly authorized and detect the failure conditions accurately.</p><p>Example triggers are an alerting system, a log tailer, a health check daemon, or an authorized engineer via a chatbot. Such flexibility allows a high level of reuse, and permits to invest more in workflow quality and reliability.</p><p>As part of the solution, we built a daemon that is able to poll a signal source for any unwanted condition and trigger a configured workflow. We have initially found <a href="https://blog.cloudflare.com/how-cloudflare-runs-prometheus-at-scale"><u>Prometheus</u></a> useful as a source because it contains both service-level and hardware/system-level metrics. We are also exploring more event-based trigger mechanisms, which could eliminate the need to use precious system resources to poll for metrics.</p><p>We already had internal services that are able to detect widespread failure conditions for our customers, but were only able to page a human. With the adoption of auto-remediation, these systems are now able to react automatically. This ability to create an automatic feedback loop with our customers is the cornerstone of these self-healing capabilities, and we continue to work on stronger signals, faster reaction times, and better prevention of future occurrences.</p><p>The most exciting part, however, is the future possibility. Every customer cares about any negative impact from Cloudflare. With this platform we can onboard several services (especially those that are foundational for the critical path) and ensure we react quickly to any failure conditions, even before there is any visible impact.</p>
    <div>
      <h3>Step four: packaging and deployment</h3>
      <a href="#step-four-packaging-and-deployment">
        
      </a>
    </div>
    <p>The whole system is written in <a href="https://go.dev/"><u>golang</u></a>, and a single binary can implement each role. We distribute it as an apt package or a container for maximum ease of deployment.</p><p>We deploy a Temporal-based worker to every server we intend to run tasks on, and a daemon in datacenters where we intend to automatically trigger workflows based on the local conditions. The coordinator is more nuanced since we rely on task routing and can trigger from a central coordinator, but we have also found value in running coordinators locally in the datacenters. This is especially useful in datacenters with less capacity or degraded performance, removing the need for a round-trip to schedule the workflows.</p>
    <div>
      <h3>Step five: test, test, test</h3>
      <a href="#step-five-test-test-test">
        
      </a>
    </div>
    <p>Temporal provides native mechanisms to test an entire workflow, via a <a href="https://docs.temporal.io/develop/go/testing-suite"><u>comprehensive test suite</u></a> that supports end-to-end, integration, and unit testing, which we used extensively to prevent regressions while developing. We also ensured proper test coverage for all the critical platform components, especially the coordinator.</p><p>Despite the ease of written tests, we quickly discovered that they were not enough. After writing workflows, engineers need an environment as close as possible to the target conditions. This is why we configured our staging environments to support quick and efficient testing. These environments receive the latest changes and point to a different (staging) Temporal cluster, which enables experimentation and easy validation of changes.</p><p>After a workflow is validated in the staging environment, we can then do a full release to production. It seems obvious, but catching simple configuration errors before releasing has saved us many hours in development/change-related-task time.</p>
    <div>
      <h2>Deploying to production</h2>
      <a href="#deploying-to-production">
        
      </a>
    </div>
    <p>As you can guess from the title of this post, we put this in production to automatically react to server-specific errors and unrecoverable failures. To this end, we have a set of services that are able to detect single-server failure conditions based on analyzed traffic data. After deployment, we have successfully mitigated potential impact by taking any errant single sources of failure out of production.</p><p>We have also created a set of workflows to reduce internal toil and improve efficiency. These workflows can automatically test pull requests on target machines, wipe and reset servers after experiments are concluded, and take away manual processes that cost many hours in toil.</p><p>Building a system that is maintained by several SRE teams has allowed us to iterate faster, and rapidly tackle long-standing problems. We have set ambitious goals regarding toil elimination and are on course to achieve them, which will allow us to scale faster by eliminating the human bottleneck.</p>
    <div>
      <h2>Looking to the future</h2>
      <a href="#looking-to-the-future">
        
      </a>
    </div>
    <p>Our immediate plans are to leverage this system to provide a more reliable platform for our customers and drastically reduce operational toil, freeing up engineering resources to tackle larger-scale problems. We also intend to leverage more Temporal features such as <a href="https://docs.temporal.io/develop/go/versioning"><u>Workflow Versioning</u></a>, which will simplify the process of making changes to workflows by ensuring that triggered workflows run expected versions. </p><p> We are also interested in how others are solving problems using durable execution platforms such as Temporal, and general strategies to eliminate toil. If you would like to discuss this further, feel free to reach out on the <a href="https://community.cloudflare.com"><u>Cloudflare Community</u></a> and start a conversation!</p><p>If you’re interested in contributing to projects that help build a better Internet, <a href="https://www.cloudflare.com/en-gb/careers/jobs/?department=Engineering&amp;location=default"><u>our engineering teams are hiring</u></a>.</p> ]]></content:encoded>
            <category><![CDATA[Edge]]></category>
            <category><![CDATA[Engineering]]></category>
            <category><![CDATA[Serverless]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Go]]></category>
            <category><![CDATA[Reliability]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">2i9tHkPAfy7GxYAioGM100</guid>
            <dc:creator>Opeyemi Onikute</dc:creator>
        </item>
        <item>
            <title><![CDATA[Introducing Speed Brain: helping web pages load 45% faster]]></title>
            <link>https://blog.cloudflare.com/introducing-speed-brain/</link>
            <pubDate>Wed, 25 Sep 2024 13:00:00 GMT</pubDate>
            <description><![CDATA[ Speed Brain uses the Speculation Rules API to prefetch content for the user's likely next navigations. The goal is to download a web page to the browser before a user navigates to it. 
 ]]></description>
            <content:encoded><![CDATA[ <p>Each time a user visits your web page, they are initiating a race to receive content as quickly as possible. Performance is a critical <a href="https://www.speedcurve.com/blog/psychology-site-speed/"><u>factor</u></a> that influences how visitors interact with your site. Some might think that moving content across the globe introduces significant latency, but for a while, network transmission speeds have approached their <a href="https://blog.cloudflare.com/fastest-internet/"><u>theoretical limits</u></a>. To put this into perspective, data on Cloudflare can traverse the 11,000 kilometer round trip between New York and London in about 76 milliseconds – faster than the <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4043155/#:~:text=one%20blink%20lasts%20about%201/3%20s"><u>blink of an eye</u></a>.</p><p>However, delays in loading web pages persist due to the complexities of processing requests, responses, and configurations. In addition to pushing advancements in <a href="https://blog.cloudflare.com/a-relatively-easy-to-understand-primer-on-elliptic-curve-cryptography/"><u>connection establishment</u></a>, <a href="https://blog.cloudflare.com/this-is-brotli-from-origin/"><u>compression</u></a>, <a href="https://blog.cloudflare.com/cloudflare-gen-12-server-bigger-better-cooler-in-a-2u1n-form-factor/"><u>hardware</u></a>, and <a href="https://blog.cloudflare.com/pingora-open-source/"><u>software</u></a>, we have built a new way to reduce page load latency by anticipating how visitors will interact with a given web page. </p><p>Today we are very excited to share the latest leap forward in speed: <b>Speed Brain</b>. It relies on the <a href="https://developer.chrome.com/docs/web-platform/prerender-pages"><u>Speculation Rules API </u></a>to <a href="https://developer.mozilla.org/en-US/docs/Glossary/Prefetch"><u>prefetch</u></a> the content of the user's likely next navigations. The main goal of Speed Brain is to download a web page to the browser cache before a user navigates to it, allowing pages to load almost instantly when the actual navigation takes place. </p><p>Our initial approach uses a <a href="https://developer.chrome.com/blog/speculation-rules-improvements#eagerness"><u>conservative</u></a> model that prefetches static content for the next page when a user starts a touch or <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event"><u>click event</u></a>. Through the fourth quarter of 2024 and into 2025, we will offer more aggressive speculation models, such as speculatively <a href="https://developer.mozilla.org/en-US/docs/Glossary/Prerender"><u>prerendering</u></a> (not just fetching the page before the navigation happens but rendering it completely) for an even faster experience. Eventually, Speed Brain will learn how to eliminate latency for your static website, without any configuration, and work with browsers to make sure that it loads as fast as possible.  </p><p>To illustrate, imagine an ecommerce website selling clothing. Using the insights from our global request logs, we can predict with high accuracy that a typical visitor is likely to click on ‘Shirts’ when viewing the parent page ‘Mens &gt; Clothes’. Based on this, we can start delivering static content, like images, before the shopper even clicks the ‘Shirts’ link. As a result, when they inevitably click, the page loads instantly. <b>Recent lab testing of our aggressive loading model implementation has shown up to a 75% reduction in </b><a href="https://developer.mozilla.org/en-US/docs/Glossary/Largest_contentful_paint"><b><u>Largest Contentful Paint (LCP)</u></b></a>, the time it takes for the largest visible element (like an image, video, or text block) to load and render in the browser.</p><p>The best part? We are making Speed Brain available to all plan types immediately and at no cost. Simply toggle on the Speed Brain feature for your website from the <a href="https://dash.cloudflare.com/?to=/:account/:zone/speed/optimization/content"><u>dashboard</u></a> or the <a href="https://developers.cloudflare.com/api/operations/zone-settings-get-speed-brain-setting"><u>API</u></a>. It’ll feel like magic, but behind the scenes it's a lot of clever engineering. </p><p>We have already enabled Speed Brain by default on <u>all</u> free domains and are seeing a <b>reduction in LCP of 45% on successful prefetches.</b> Pro, Business, and Enterprise domains need to enable Speed Brain manually. If you have not done so already, we <b>strongly</b> recommend also <a href="https://developers.cloudflare.com/web-analytics/get-started/#sites-proxied-through-cloudflare"><u>enabling Real User Measurements (RUM)</u></a> via your dashboard so you can see your new and improved web page performance. As a bonus, enabling RUM for your domain will help us provide <b>improved</b> and <b>customized</b> prefetching and prerendering rules for your website in the near future!</p>
    <div>
      <h2>How browsers work at a glance</h2>
      <a href="#how-browsers-work-at-a-glance">
        
      </a>
    </div>
    <p>Before discussing how Speed Brain can help load content exceptionally fast, we need to take a step back to review the complexity of loading content on browsers. Every time a user navigates to your web page, a series of request and response cycles must be completed. </p><p>After the browser <a href="https://www.debugbear.com/blog/http-server-connections"><u>establishes a secure connection</u></a> with a server, it sends an HTTP request to retrieve the base document of the web page. The server processes the request, constructs the necessary HTML document and sends it back to the browser in the response. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6hxlOWcShKyU4y6sqNYQs1/5717e4ebc130887376d629f9926d7a98/BLOG-2422_2.png" />
          </figure><p>When the browser receives an HTML document, it immediately begins <a href="https://developer.mozilla.org/en-US/docs/Web/Performance/How_browsers_work#parsing"><u>parsing</u></a> the content. During this process, it may encounter references to external resources such as CSS files, JavaScript, images, and fonts. These subresources are essential for rendering the page correctly, so the browser issues additional HTTP requests to fetch them. However, if these resources are available in the browser’s cache, the browser can retrieve them locally, significantly reducing <a href="https://www.cloudflare.com/learning/performance/glossary/what-is-latency/"><u>network latency</u></a> and improving page load times.</p><p>As the browser processes HTML, CSS, and JavaScript, the rendering engine begins to display content on the screen. Once the page’s visual elements are displayed, user interactions — like clicking a link — prompt the browser to restart much of this process to fetch new content for the next page. This workflow is typical of every browsing session: as users navigate, the browser continually fetches and renders new or uncached resources, introducing a delay before the new page fully loads.</p><p>Take the example of a user navigating the shopping site described above. As the shopper moves from the homepage to the ‘men's’ section of the site to the ‘clothing’ section to the ‘shirts’ section, the time spent on retrieving each of those subsequent pages can add up and contribute to the shopper leaving the site before they complete the transaction.  </p><p>Ideally, having prefetched and prerendered pages present in the browser at the time each of those links are clicked would eliminate much of the network latency impact, allowing the browser to load content instantly and providing a smoother user experience. </p>
    <div>
      <h2>Wait, I’ve heard this story before (how did we get to Speed Brain?)</h2>
      <a href="#wait-ive-heard-this-story-before-how-did-we-get-to-speed-brain">
        
      </a>
    </div>
    <p>We know what you’re thinking. We’ve had prefetching for years. There have even been several speculative prefetching efforts in the past. You’ve heard this all before. How is this different now?</p><p>You’re right, of course. Over the years, there has been a constant effort by developers and browser vendors to optimize page load times and enhance user experience across the web. Numerous techniques have been developed, spanning various layers of the Internet stack — from optimizing network layer connectivity to preloading application content closer to the client.</p>
    <div>
      <h4>Early prefetching: lack of data and flexibility</h4>
      <a href="#early-prefetching-lack-of-data-and-flexibility">
        
      </a>
    </div>
    <p>Web prefetching has been one such technique that has existed for more than a decade. It is based on the assumption that certain subresources are likely to be needed in the near future, so why not fetch them proactively? This could include anything from HTML pages to images, stylesheets, or scripts that the user might need as they navigate through a website. In fact, the core concept of speculative execution is not new, as it's a general technique that's been employed in various areas of computer science for years, with <a href="https://en.wikipedia.org/wiki/Branch_predictor"><u>branch prediction</u></a> in CPUs as a prime example.</p><p>In the early days of the web, several custom prefetching solutions emerged to enhance performance. For example, in 2005, Google introduced the <a href="https://google.fandom.com/wiki/Google_Web_Accelerator"><u>Google Web Accelerator</u></a>, a client-side application aimed at speeding up browsing for broadband users. Though innovative, the project was short-lived due to privacy and compatibility issues (we will describe how Speed Brain is different below). Predictive prefetching at that time lacked the data insights and API support for capturing user behavior, especially those handling sensitive actions like deletions or purchases.</p>
    <div>
      <h4>Static lists and manual effort</h4>
      <a href="#static-lists-and-manual-effort">
        
      </a>
    </div>
    <p>Traditionally, prefetching has been accomplished through the use of the <code>&lt;link rel="prefetch"&gt;</code> attribute as one of the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/prefetch"><u>Resource Hints</u></a>. Developers had to manually specify the attribute on each page for each resource they wanted the browser to preemptively fetch and cache in memory. This manual effort has not only been laborious but developers often lacked insight into what resources should be prefetched, which reduced the quality of their specified hints.</p><p>In a similar vein, <a href="https://developers.cloudflare.com/speed/optimization/content/prefetch-urls/"><u>Cloudflare has offered a URL prefetching feature since 2015</u></a>. Instead of prefetching in browser cache, Cloudflare allows customers to prefetch a static list of resources into the CDN cache. The feature allows prefetching resources in advance of when they are actually needed, usually during idle time or when network conditions are favorable. However, similar concerns apply for CDN prefetching, since customers have to manually decide on what resources are good candidates for prefetching for each page they own. If misconfigured, static link prefetching can be a <a href="https://en.wiktionary.org/wiki/footgun"><u>footgun</u></a>, causing the web page load time to actually slow down.</p>
    <div>
      <h4>Server Push and its struggles</h4>
      <a href="#server-push-and-its-struggles">
        
      </a>
    </div>
    <p><a href="https://datatracker.ietf.org/doc/html/rfc9113#name-server-push"><u>HTTP/2’s "server push"</u></a> was another attempt to improve web performance by pushing resources to the client before they were requested. In theory, this would reduce latency by eliminating the need for additional round trips for future assets. However, the server-centric dictatorial nature of "pushing" resources to the client raised significant challenges, primarily due to lack of context about what was already cached in the browser. This not only wasted bandwidth but had the potential to slow down the delivery of critical resources, like base HTML and CSS, due to race conditions on browser fetches when rendering the page. The <a href="https://datatracker.ietf.org/doc/html/draft-kazuho-h2-cache-digest-01"><u>proposed solution of cache digests</u></a>, which would have informed servers about client cache contents, never gained widespread implementation, leaving servers to push resources blindly. <a href="https://developer.chrome.com/blog/removing-push"><u>In October 2022, Google Chrome removed Server Push support</u></a>, and in September 2024, <a href="https://groups.google.com/a/mozilla.org/g/dev-platform/c/vU9hJg343U8/m/4cZsHz7TAQAJ"><u>Firefox followed suit</u></a>.</p>
    <div>
      <h4>A step forward with Early Hints</h4>
      <a href="#a-step-forward-with-early-hints">
        
      </a>
    </div>
    <p>As a successor, <a href="https://datatracker.ietf.org/doc/html/rfc8297"><u>Early Hints</u></a> was specified in 2017 but not widely adopted until 2022, when <a href="https://blog.cloudflare.com/early-hints"><u>we partnered with browsers and key customers to deploy it</u></a>. It offers a more efficient alternative by "hinting" to clients which resources to load, allowing better prioritization based on what the browser needs. Specifically, the server sends a 103 Early Hints HTTP status code with a list of key page assets that the browser should start loading while the main response is still being prepared. This gives the browser a head start in fetching essential resources and avoids redundant preloading if assets are already cached. Although Early Hints doesn't adapt to user behaviors or dynamic page conditions (yet), its use is primarily limited to preloading specific assets rather than full web pages — in particular, cases where there is a long server “think time” to produce HTML.</p><p>As the web evolves, tools that can handle complex, dynamic user interactions will become increasingly important to balance the performance gains of speculative execution with its potential drawbacks for end-users. For years Cloudflare has offered performance-based solutions that adapt to user behavior and work to balance the speed and correctness decisions across the Internet like <a href="https://www.cloudflare.com/application-services/products/argo-smart-routing/"><u>Argo Smart Routing</u></a>, <a href="https://blog.cloudflare.com/introducing-smarter-tiered-cache-topology-generation/"><u>Smart Tiered Cache</u></a>, and <a href="https://developers.cloudflare.com/workers/configuration/smart-placement/"><u>Smart Placement</u></a>. Today we take another step forward toward an adaptable framework for serving content lightning-fast. </p>
    <div>
      <h2>Enter Speed Brain: what makes it different?</h2>
      <a href="#enter-speed-brain-what-makes-it-different">
        
      </a>
    </div>
    <p>Speed Brain offers a robust approach for implementing predictive prefetching strategies directly within the browser based on the ruleset returned by our servers. By building on lessons from previous attempts, it shifts the responsibility for resource prediction to the client, enabling more dynamic and personalized optimizations based on user interaction – like hovering over a link, for example – and their device capabilities. Instead of the browser sitting idly waiting for the next web page to be requested by the user, it takes cues from how a user is interacting with a page and begins asking for the next web page before the user finishes clicking on a link.</p><p>Behind the scenes, all of this magic is made possible by the <a href="https://developer.chrome.com/docs/web-platform/prerender-pages#speculation-rules-api"><u>Speculation Rules API</u></a>, which is an emerging standard in the web performance space from Google. When Cloudflare’s Speed Brain feature is enabled, an HTTP header called Speculation-Rules is added to web page responses. The value for this header is a URL that hosts an opinionated Rules configuration. This configuration instructs the browser to initiate prefetch requests for future navigations. Speed Brain does not improve page load time for the first page that is visited on a website, but it can improve it for subsequent web pages that are visited on the same site.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/Fu2ADDum0Pp9e5kq94Jd4/3eba0ffc4d94c42af67d4e9c1c708a29/BLOG-2422_3.png" />
          </figure><p>The idea seems simple enough, but <a href="https://developer.mozilla.org/en-US/docs/Web/API/Speculation_Rules_API#unsafe_prefetching"><u>prefetching comes with challenges</u></a>, as some prefetched content may never end up being used. With the initial release of Speed Brain, we have designed a solution with guardrails that addresses two important but distinct issues that limited previous speculation efforts — <i>stale prefetch configuration</i> and <i>incorrect prefetching. </i>The Speculation Rules API configuration we have chosen for this initial release has been carefully designed to balance safety of prefetching while still maintaining broad applicability of rules for the entire site.</p>
    <div>
      <h4>Stale prefetch configuration</h4>
      <a href="#stale-prefetch-configuration">
        
      </a>
    </div>
    <p>As websites inevitably change over time, static prefetch configurations often become outdated, leading to <a href="https://www.cloudflare.com/learning/cdn/common-cdn-issues/">inefficient or ineffective prefetching</a>. This has been especially true for techniques like the rel=prefetch attribute or static CDN prefetching URL sets, which have required developers to manually maintain relevant prefetchable URL lists for each page of their website. Most static prefetch lists are based on developer intuition rather than real user navigation data, potentially missing important prefetch opportunities or wasting resources on unnecessary prefetches. </p>
    <div>
      <h4>Incorrect prefetching</h4>
      <a href="#incorrect-prefetching">
        
      </a>
    </div>
    <p>Since prefetch requests are just like normal requests except with a `sec-purpose` HTTP request header, they incur the same overhead on the client, network, and server. However, the crucial difference is that prefetch requests anticipate user behavior and the response might not end up being used, <a href="https://developer.mozilla.org/en-US/docs/Web/API/Speculation_Rules_API#unsafe_prefetching"><u>so all that overhead might be wasted</u></a>. This makes prefetch accuracy extremely important — that is, maximizing the percentage of prefetched pages that end up being viewed by the user. Incorrect prefetching can lead to inefficiencies and unneeded costs, such as caching resources that aren't requested, or wasting bandwidth and network resources, which is especially critical on metered mobile networks or in low-bandwidth environments.</p>
    <div>
      <h3>Guardrails</h3>
      <a href="#guardrails">
        
      </a>
    </div>
    <p>With the initial release of Speed Brain, we have designed a solution with important side effect prevention guardrails that completely removes the chance of <i>stale prefetch configuration</i>, and minimizes the risk of<i> incorrect prefetching</i>. This opinionated configuration is achieved by leveraging the <a href="https://developer.chrome.com/blog/speculation-rules-improvements"><u>document rules</u></a> and <a href="https://developer.chrome.com/blog/speculation-rules-improvements#eagerness"><u>eagerness</u></a> settings from the <a href="https://developer.chrome.com/docs/web-platform/prerender-pages#speculation-rules-api"><u>Speculation Rules API</u></a>. Our chosen configuration looks like the following:</p>
            <pre><code>{
  "prefetch": [{
    "source": "document",
    "where": {
      "and": [
        { "href_matches": "/*", "relative_to": "document" },
      ]
    },
    "eagerness": "conservative"
  }]
}
</code></pre>
            
    <div>
      <h5>
Document Rules</h5>
      <a href="#document-rules">
        
      </a>
    </div>
    <p><a href="https://developer.chrome.com/blog/speculation-rules-improvements"><u>Document Rules</u></a>, indicated by "source": "document" and the "where" key in the configuration, allows prefetching to be applied dynamically over the entire web page. This eliminates the need for a predefined static URL list for prefetching. Hence, we remove the problem of <i>stale prefetch configuration</i> as prefetch candidate links are determined based on the active page structure.</p><p>Our use of "relative_to": "document" in the where clause instructs the browser to limit prefetching to same-site links. This has the added bonus of allowing our implementation to avoid cross-origin prefetches to avoid any privacy implications for users, as it doesn’t follow them around the web. </p>
    <div>
      <h5>Eagerness</h5>
      <a href="#eagerness">
        
      </a>
    </div>
    <p><a href="https://developer.chrome.com/docs/web-platform/prerender-pages#eagerness"><u>Eagerness</u></a> controls how aggressively the browser prefetches content. There are four possible settings:</p><ul><li><p><b><i>immediate</i></b><i>: Used as soon as possible on page load — generally as soon as the rule value is seen by the browser, it starts prefetching the next page.</i></p></li><li><p><b><i>eager</i></b><i>: Identical to immediate setting above, but the prefetch trigger additionally relies on slight user interaction events, such as moving the cursor towards the link (coming soon).</i></p></li><li><p><b><i>moderate</i></b><i>: Prefetches if you hold the pointer over a link for more than 200 milliseconds (or on the </i><a href="https://developer.mozilla.org/docs/Web/API/Element/pointerdown_event"><i><u>pointerdown</u></i></a><i> event if that is sooner, and on mobile where there is no hover event).</i></p></li><li><p><b><i>conservative</i></b><i>: Prefetches on pointer or touch down on the link.</i></p></li></ul><p>Our initial release of Speed Brain makes use of the <b><u>conservative</u></b> eagerness value to minimize the risk of incorrect prefetching, which can lead to unintended resource waste while making your websites noticeably faster. While we lose out on the potential performance improvements that the more aggressive eagerness settings offer, we chose this cautious approach to prioritize safety for our users. Looking ahead, we plan to explore more dynamic eagerness settings for sites that could benefit from a more liberal setting, and we'll also expand our rules to include <a href="https://developer.mozilla.org/en-US/docs/Glossary/Prerender"><u>prerendering</u></a>.</p><p>Another important safeguard we implement is to only accept prefetch requests for static content that is already stored in our CDN cache. If the content isn't in the cache, we reject the prefetch request. Retrieving content directly from our CDN cache for prefetching requests lets us bypass concerns about their cache eligibility. The rationale for this is straightforward: if a page is not eligible for caching, we don't want it to be prefetched in the browser cache, as it could lead to unintended consequences and increased origin load. For instance, prefetching a logout page might log the user out prematurely before the user actually finishes their action. Stateful prefetching or prerendering requests can have unpredictable effects, potentially altering the server's state for actions the client has not confirmed. By only allowing prefetching for pages already in our CDN cache, we have confidence those pages will not negatively impact the user experience.</p><p>These guardrails were implemented to work in performance-sensitive environments. We measured the impact of our baseline conservative deployment model on all pages across <a href="https://developers.cloudflare.com/"><u>Cloudflare’s developer documentation</u></a> in early July 2024. We found that we were able to prefetch the correct content, content that would in fact be navigated to by the users, <b>94</b>% of the time. We did this while improving the performance of the navigation by reducing LCP at p75 quantile by <b>40</b>% without inducing any unintended side effects. The results were amazing!</p>
    <div>
      <h2>Explaining Cloudflare’s implementation </h2>
      <a href="#explaining-cloudflares-implementation">
        
      </a>
    </div>
    <p>Our global <a href="https://www.cloudflare.com/network"><u>network</u></a> spans over 330 cities and operates within 50 milliseconds of 95% of the Internet-connected population. This extensive reach allows us to significantly improve the performance of cacheable assets for our customers. By leveraging this network for smart prefetching with Speed Brain, Cloudflare can serve prefetched content directly from the CDN cache, reducing network latency to practically instant.</p><p>Our unique position on the network provides us the leverage to automatically enable Speed Brain without requiring any changes from our customers to their origin server configurations. It's as simple as flipping a switch! Our first version of Speed Brain is now live.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/O3RwzUlOj1GlJuMSrq5TW/55d9ef31a2de21034eb036b8c029d5b6/BLOG-2422_4.png" />
          </figure><ul><li><p>Upon receiving a request for a web page with Speed Brain enabled, the Cloudflare server returns an additional "Speculation-Rules" HTTP response header. The value for this header is a URL that hosts an opinionated Rules configuration (as mentioned above).</p></li><li><p>When the browser begins parsing the response header, it fetches our Speculation-Rules configuration, and loads it as part of the web page.</p></li><li><p>The configuration guides the browser on when to prefetch the next likely page from Cloudflare that the visitor may navigate to, based on how the visitor is engaging with the page.</p></li><li><p>When a user action (such as mouse down event on the next page link) triggers the Rules application, the browser sends a prefetch request for that page with the "sec-purpose: prefetch" HTTP request header.</p></li><li><p>Our server parses the request header to identify the prefetch request. If the requested content is present in our cache, we return it; otherwise,<b> we return a 503 HTTP status </b>code and deny the prefetch request. This removes the risk of unsafe side-effects of sending requests to origins or Cloudflare Workers that are unaware of prefetching. Only content present exclusively in the cache is returned.</p></li><li><p>On a success response, the browser successfully prefetches the content in memory, and when the visitor navigates to that page, the browser directly loads the web page from the browser cache for immediate rendering.</p></li></ul>
    <div>
      <h2>Common troubleshooting patterns </h2>
      <a href="#common-troubleshooting-patterns">
        
      </a>
    </div>
    <p>Support for Speed Brain relies on the <a href="https://developer.chrome.com/docs/web-platform/prerender-pages"><u>Speculation Rules API</u></a>, an emerging web standard. As of September 2024, <a href="https://caniuse.com/mdn-http_headers_speculation-rules"><u>support for this emerging standard</u></a> is limited to <b>Chromium-based browsers (version 121 or later)</b>, such as Google Chrome and Microsoft Edge. As the web community reaches consensus on API standardization, we hope to see wider adoption across other browser vendors.</p><p>Prefetching by nature does not apply to dynamic content, as the state of such content can change, potentially leading to stale or outdated data being delivered to the end user as well as increased origin load. Therefore, Speed Brain will only work for non-dynamic pages of your website that are cached on our network. It has no impact on the loading of dynamic pages. To get the most benefit out of Speed Brain, we suggest making use of <a href="https://developers.cloudflare.com/cache/how-to/cache-rules/"><u>cache rules</u></a> to ensure that all static content (<b>especially HTML content</b>) on your site is eligible for caching.</p><p>When the browser receives a 503 HTTP status code in response to a speculative prefetch request (marked by the sec-purpose: prefetch header), it cancels the prefetch attempt. Although a 503 error appearing in the browser's console may seem alarming, it is completely harmless for prefetch request cancellation. In our early tests, the 503 response code has caused some site owners concern. We are working with our partners to iterate on this to improve the client experience, but for now follow the specification guidance, <a href="https://developer.mozilla.org/en-US/docs/Web/API/Speculation_Rules_API#:~:text=Using%20a%20non%2Dsuccess%20code%20(for%20example%20a%20503)%20is%20the%20easiest%20way%20to%20prevent%20speculative%20loading"><u>which suggests a 503 response</u></a> for the browser to safely discard the speculative request. We're in active discussions with Chrome, based on feedback from early beta testers, and believe a new non-error dedicated response code would be more appropriate, and cause less confusion. In the meantime, 503 response logs for prefetch requests related to Speed Brain are harmless. If your tooling makes ignoring these requests difficult, you can temporarily disable Speed Brain until we work out something better with the Chrome Team.</p><p>Additionally, when a website uses both its own custom Speculation Rules and Cloudflare's Speed Brain feature, both rule sets can operate simultaneously. Cloudflare’s guardrails will limit speculation rules to cacheable pages, which may be an unexpected limitation for those with existing implementations. If you observe such behavior, consider disabling one of the implementations for your site to ensure consistency in behavior. Note that if your origin server responses include the Speculation-Rules header, it will not be overridden. Therefore, the potential for ruleset conflicts primarily applies to predefined in-line speculation rules.</p>
    <div>
      <h2>How can I see the impact of Speed Brain?</h2>
      <a href="#how-can-i-see-the-impact-of-speed-brain">
        
      </a>
    </div>
    <p>In general, we suggest that you use Speed Brain and most other Cloudflare performance <a href="https://developers.cloudflare.com/speed/"><u>features</u></a> with our <a href="https://developers.cloudflare.com/web-analytics/get-started/#sites-proxied-through-cloudflare"><u>RUM performance measurement tool</u></a> enabled. Our RUM feature helps developers and website operators understand how their end users are experiencing the performance of their application, providing visibility into:</p><ul><li><p><b>Loading</b>: How long did it take for content to become available?</p></li><li><p><b>Interactivity</b>: How responsive is the website when users interact with it?</p></li><li><p><b>Visual stability</b>: How much does the page move around while loading?</p></li></ul><p>With RUM enabled, you can navigate to the Web Analytics section in the dashboard to see important information about how Speed Brain is helping reduce latency in your <a href="https://www.cloudflare.com/learning/performance/what-are-core-web-vitals/"><u>core web vitals</u></a> metrics like Largest Contentful Paint (LCP) and load time. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6zv2kRvsot12PSNwwaWCad/25e9e56d6f3769b04a8752f99c656f3b/BLOG-2422_5.png" />
          </figure><p><sub><i>Example RUM dashboard for a website with a high amount of prefetchable content that enabled Speed Brain around September 16.</i></sub></p>
    <div>
      <h2>What have we seen in our rollout so far? </h2>
      <a href="#what-have-we-seen-in-our-rollout-so-far">
        
      </a>
    </div>
    <p>We have enabled this feature by default on all free plans and have observed the following:</p>
    <div>
      <h3>Domains</h3>
      <a href="#domains">
        
      </a>
    </div>
    <p>Cloudflare currently has tens of millions of domains using Speed Brain. We have measured the LCP at the 75th quantile (p75) for these sites and found an improvement for these sites between 40% and 50% (average around 45%). </p><p>We found this improvement by comparing navigational prefetches to normal (non-prefetched) page loads for the same set of domains. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/fNrRh84I3iZpHiEieNPg8/a789d9d9a736a8eb76fa6120a84cdf10/BLOG-2422_6.png" />
          </figure>
    <div>
      <h3>Requests</h3>
      <a href="#requests">
        
      </a>
    </div>
    <p>Before Speed Brain is enabled, the p75 of free websites on Cloudflare experience an LCP around 2.2 seconds. With Speed Brain enabled, these sites see significant latency savings on LCP. In aggregate, Speed Brain saves about 0.88 seconds on the low end and up to 1.1 seconds on each successful prefetch! </p>
    <div>
      <h3>Applicable browsers</h3>
      <a href="#applicable-browsers">
        
      </a>
    </div>
    <p>Currently, the Speculation Rules API is only available in Chromium browsers. From Cloudflare Radar, we can see that approximately <a href="https://radar.cloudflare.com/adoption-and-usage"><u>70% of requests</u></a> from visitors are from <a href="https://en.wikipedia.org/wiki/Chromium_(web_browser)"><u>Chromium</u></a> (Chrome, Edge, etc) browsers.</p>
    <div>
      <h3>Across the network</h3>
      <a href="#across-the-network">
        
      </a>
    </div>
    <p>Cloudflare sees hundreds of billions of requests for HTML content each day. Of these requests, about half are cached (make sure your HTML is cacheable!). Around 1% of those requests are for navigational prefetching made by the visitors. This represents significant savings every day for visitors to websites with Speed Brain enabled. Every 24 hours, <b>Speed Brain can save more than 82 years worth of latency!</b></p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5CIpcdPC17LY2EGjNxCjNo/cf1a915d16384e32d88951a48febed47/BLOG-2422_7.png" />
          </figure>
    <div>
      <h2>What’s next? </h2>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>What we’re offering today for Speed Brain is only the beginning. Heading into 2025, we have a number of exciting additions to explore and ship. </p>
    <div>
      <h3>Leveraging Machine Learning</h3>
      <a href="#leveraging-machine-learning">
        
      </a>
    </div>
    <p>Our unique position on the Internet provides us valuable insights into web browsing patterns, which we can leverage for improving web performance while maintaining individual user privacy. By employing a generalized data-driven machine learning approach, we can define more accurate and site-specific prefetch predictors for users’ pages. </p><p>We are in the process of developing an adaptive speculative model that significantly improves upon our current conservative offering. This model uses a privacy-preserving method to generate a user traversal graph for each site based on same-site Referrer headers. For any two pages connected by a navigational hop, our model predicts the likelihood of a typical user moving between them, using insights extracted from our aggregated traffic data.</p><p>This model enables us to tailor rule sets with custom eagerness values to each relevant next page link on your site. For pages where the model predicts high confidence in user navigation, the system will aggressively prefetch or prerender them. If the model does not provide a rule for a page, it defaults to our existing conservative approach, maintaining the benefits of baseline Speed Brain model. These signals guide browsers in prefetching and prerendering the appropriate pages, which helps speed up navigation for users, while maintaining our current safety guardrails.</p><p>In lab tests, our ML model improved LCP latency by 75% and predicted visitor navigation with ~98% accuracy, ensuring the correct pages were being prefetched to prevent resource waste for users. As we move toward scaling this solution, we are focused on periodic training of the model to adapt to varying user behaviors and evolving websites. Using an online machine learning approach will drastically reduce the need for any manual update, and content drifts, while maintaining high accuracy — the Speed Brain load solution that gets smarter over time!</p>
    <div>
      <h3>Finer observability via RUM</h3>
      <a href="#finer-observability-via-rum">
        
      </a>
    </div>
    <p>As we’ve mentioned, we believe that our RUM tools offer the best insights for how Speed Brain is helping the performance of your website. In the future, we plan on offering the ability to filter RUM tooling by navigation type so that you can compare the browser rendering of prefetched content versus non-prefetched content. </p>
    <div>
      <h3>Prerendering</h3>
      <a href="#prerendering">
        
      </a>
    </div>
    <p>We are currently offering the ability for prefetching on cacheable content. Prefetching downloads the main document resource of the page before the user’s navigation, but it does not instruct the browser to prerender the page or download any additional subresources.</p><p>In the future, Cloudflare’s Speed Brain offering will prefetch content into our CDN cache and then work with browsers to know what are the best prospects for prerendering. This will help get static content even closer to instant rendering. </p>
    <div>
      <h3>Argo Smart Browsing: Speed Brain &amp; Smart Routing</h3>
      <a href="#argo-smart-browsing-speed-brain-smart-routing">
        
      </a>
    </div>
    <p>Speed Brain, in its initial implementation, provides an incredible performance boost whilst still remaining conservative in its implementation; both from an eagerness, and a resource consumption perspective.</p><p>As was outlined earlier in the post, lab testing of a more aggressive model, powered by machine-learning and a higher eagerness, yielded a <b>75% reduction in LCP.</b> We are investigating bundling this more aggressive, additional implementation of Speed Brain with Argo Smart Routing into a product called <b>“Argo Smart Browsing”. </b></p><p>Cloudflare customers will be free to continue using Speed Brain, however those who want even more performance improvement will be able to enable Argo Smart Browsing with a single button click.  With Argo Smart Browsing, not only will cacheable static content load up to 75% faster in the browser, thanks to the more aggressive models, however in times when content can’t be cached, and the request must go forward to an origin server, it will be sent over the most performant network path resulting in an average <b>33% performance increase.</b> Performance optimizations are being applied to almost every segment of the request lifecycle regardless if the content is static or dynamic, cached or not. </p>
    <div>
      <h2>Conclusion</h2>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>To get started with Speed Brain, navigate to <a href="https://dash.cloudflare.com/?to=/:account/:zone/speed/optimization/content"><b><u>Speed</u></b><u> &gt; Optimization &gt; Content Optimization &gt; </u><b><u>Speed Brain</u></b></a> in the Cloudflare Dashboard and enable it. That's all! The feature can also be enabled via <a href="https://developers.cloudflare.com/api/operations/zone-settings-get-speed-brain-setting"><u>API</u></a>.  Free plan domains have had Speed Brain enabled by default.</p><p>We strongly recommend that customers also <a href="https://developers.cloudflare.com/web-analytics/get-started/#sites-proxied-through-cloudflare"><b><u>enable RUM</u></b></a>, found in the same section of the dashboard, to give visibility into the performance improvements provided by Speed Brain and other Cloudflare features and products. </p><p>We’re excited to continue to build products and features that make web performance reliably fast. If you’re an engineer interested in improving the performance of the web for all, <a href="http://cloudflare.com/jobs">come join us</a>!</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/OaN8mrrAKAatOUCqGAsqu/15ac363626180a0f0ed1a0cdb8146e5f/BLOG-2422_8.png" />
          </figure>
    <div>
      <h3>Watch on Cloudflare TV</h3>
      <a href="#watch-on-cloudflare-tv">
        
      </a>
    </div>
    <div>
  
</div><p></p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Cache]]></category>
            <category><![CDATA[Speed Brain]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">sC3G9YR2M9IIoRMg8slDl</guid>
            <dc:creator>Alex Krivit</dc:creator>
            <dc:creator>Suleman Ahmad</dc:creator>
            <dc:creator>William Woodhead</dc:creator>
        </item>
        <item>
            <title><![CDATA[Instant Purge: invalidating cached content in under 150ms]]></title>
            <link>https://blog.cloudflare.com/instant-purge/</link>
            <pubDate>Tue, 24 Sep 2024 23:00:00 GMT</pubDate>
            <description><![CDATA[ We’ve built the fastest cache purge in the industry by offering a global purge latency for purge by tags, hostnames, and prefixes of less than 150ms on average (P50), representing a 90% improvement.  ]]></description>
            <content:encoded><![CDATA[ <p><sup>(part 3 of the Coreless Purge </sup><a href="https://blog.cloudflare.com/rethinking-cache-purge-architecture/"><sup>series</sup></a><sup>)</sup></p><p>Over the past 14 years, Cloudflare has evolved far beyond a Content Delivery Network (CDN), expanding its offerings to include a comprehensive <a href="https://developers.cloudflare.com/cloudflare-one/"><u>Zero Trust</u></a> security portfolio, network security &amp; performance <a href="https://www.cloudflare.com/network-services/products/"><u>services</u></a>, application security &amp; performance <a href="https://www.cloudflare.com/application-services/products/"><u>optimizations</u></a>, and a powerful <a href="https://www.cloudflare.com/developer-platform/products/"><u>developer platform</u></a>. But customers also continue to rely on Cloudflare for caching and delivering static website content. CDNs are often judged on their ability to return content to visitors as quickly as possible. However, the speed at which content is removed from a CDN's global cache is just as crucial.</p><p>When customers frequently update content such as news, scores, or other data, it is essential they<a href="https://www.cloudflare.com/learning/cdn/common-cdn-issues/"> avoid serving stale, out-of-date information</a> from cache to visitors. This can lead to a <a href="https://www.cloudflare.com/learning/cdn/common-cdn-issues/">subpar experience</a> where users might see invalid prices, or incorrect news. The goal is to remove the stale content and cache the new version of the file on the CDN, as quickly as possible. And that starts by issuing a “purge.”</p><p>In May 2022, we released the <a href="https://blog.cloudflare.com/part1-coreless-purge/"><u>first part</u><b><u> </u></b></a>of the series detailing our efforts to rebuild and publicly document the steps taken to improve the system our customers use, to purge their cached content. Our goal was to increase scalability, and importantly, the speed of our customer’s purges. In that initial post, we explained how our purge system worked and the design constraints we found when scaling. We outlined how after more than a decade, we had outgrown our purge system and started building an entirely new purge system, and provided purge performance benchmarking that users experienced at the time. We set ourselves a lofty goal: to be the fastest.</p><p><b>Today, we’re excited to share that we’ve built the fastest cache purge in the industry.</b>  We now offer a global purge latency for purge by tags, hostnames, and prefixes of less than 150ms on average (P50), representing a 90% improvement since May 2022. Users can now purge from anywhere, (almost) <i>instantly</i>. By the time you hit enter on a purge request and your eyes blink, the file is now removed from our global network — including data centers in <a href="https://www.cloudflare.com/network/"><u>330 cities</u></a> and <a href="https://blog.cloudflare.com/backbone2024/"><u>120+ countries</u></a>.</p><p>But that’s not all. It wouldn’t be Birthday Week if we stopped at just being the fastest purge. We are <b><i>also</i></b><i> </i>announcing that we’re opening up more purge options to Free, Pro, and Business plans. Historically, only Enterprise customers had access to the full arsenal of <a href="https://developers.cloudflare.com/cache/how-to/purge-cache/"><u>cache purge methods</u></a> supported by Cloudflare, such as purge by cache-tags, hostnames, and URL prefixes. As part of rebuilding our purge infrastructure, we’re not only fast but we are able to scale well beyond our current capacity. This enables more customers to use different types of purge. We are excited to offer these new capabilities to all plan types once we finish rolling out our new purge infrastructure, and expect to begin offering additional purge capabilities to all plan types in early 2025. </p>
    <div>
      <h3>Why cache and purge? </h3>
      <a href="#why-cache-and-purge">
        
      </a>
    </div>
    <p>Caching content is like pulling off a spectacular magic trick. It makes loading website content lightning-fast for visitors, slashes the load on origin servers and the cost to operate them, and enables global scalability with a single button press. But here's the catch: for the magic to work, caching requires predicting the future. The right content needs to be cached in the right data center, at the right moment when requests arrive, and in the ideal format. This guarantees astonishing performance for visitors and game-changing scalability for web properties.</p><p>Cloudflare helps make this caching magic trick easy. But regular users of our cache know that getting content into cache is only part of what makes it useful. When content is updated on an origin, it must also be updated in the cache. The beauty of caching is that it holds content until it expires or is evicted. To update the content, it must be actively removed and updated across the globe quickly and completely. If data centers are not uniformly updated or are updated at drastically different times, visitors risk getting different data depending on where they are located. This is where cache “purging” (also known as “cache invalidation”) comes in.</p>
    <div>
      <h3>One-to-many purges on Cloudflare</h3>
      <a href="#one-to-many-purges-on-cloudflare">
        
      </a>
    </div>
    <p>Back in <a href="https://blog.cloudflare.com/rethinking-cache-purge-architecture/"><u>part 2 of the blog series</u></a>, we touched on how there are multiple ways of purging cache: by URL, cache-tag, hostname, URL prefix, and “purge everything”, and discussed a necessary distinction between purging by URL and the other four kinds of purge — referred to as flexible purges — based on the scope of their impact.</p><blockquote><p><i>The reason flexible purge isn’t also fully coreless yet is because it’s a more complex task than “purge this object”; flexible purge requests can end up purging multiple objects – or even entire zones – from cache. They do this through an entirely different process that isn’t coreless compatible, so to make flexible purge fully coreless we would have needed to come up with an entirely new multi-purge mechanism on top of redesigning distribution. We chose instead to start with just purge by URL, so we could focus purely on the most impactful improvements, revamping distribution, without reworking the logic a data center uses to actually remove an object from cache.</i></p></blockquote><p>We said our next steps included a redesign of flexible purges at Cloudflare, and today we’d like to walk you through the resulting system. But first, a brief history of flexible cache purges at Cloudflare and elaboration on why the old flexible purge system wasn’t “coreless compatible”.</p>
    <div>
      <h3>Just in time</h3>
      <a href="#just-in-time">
        
      </a>
    </div>
    <p>“Cache” within a given data center is made up of many machines, all contributing disk space to store customer content. When a request comes in for an asset, the URL and headers are used to calculate a <a href="https://developers.cloudflare.com/cache/how-to/cache-keys/"><u>cache key</u></a>, which is the filename for that content on disk and also determines which machine in the datacenter that file lives on. The filename is the same for every data center, and every data center knows how to use it to find the right machine to cache the content. A <a href="https://developers.cloudflare.com/cache/how-to/purge-cache/"><u>purge request</u></a> for a URL (plus headers) therefore contains everything needed to generate the cache key — the pointer to the response object on disk — and getting that key to every data center is the hardest part of carrying out the purge.</p><p>Purging content based on response properties has a different hardest part. If a customer wants to purge all content with the cache-tag “foo”, for example, there’s no way for us to generate all the cache keys that will point to the files with that cache-tag at request time. Cache-tags are response headers, and the decision of where to store a file is based on request attributes only. To find all files with matching cache-tags, we would need to look at every file in every cache disk on every machine in every data center. That’s thousands upon thousands of machines we would be scanning for each purge-by-tag request. There are ways to avoid actually continuously scanning all disks worldwide (foreshadowing!) but for our first implementation of our flexible purge system, we hoped to avoid the problem space altogether.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7n56ZDJwdBbaTNPJII6s2S/db998973efdca121536a932bc50dd842/image5.png" />
            
            </figure><p>An alternative approach to going to every machine and looking for all files that match some criteria to actively delete from disk was something we affectionately referred to as “lazy purge”. Instead of deleting all matching files as soon as we process a purge request, we wait to do so when we get an end user request for one of those files. Whenever a request comes in, and we have the file in cache, we can compare the timestamp of any recent purge requests from the file owner to the insertion timestamp of the file we have on disk. If the purge timestamp is fresher than the insertion timestamp, we pretend we didn’t find the file on disk. For this to work, we needed to keep track of purge requests going back further than a data center’s maximum cache eviction age to be sure that any file a customer sends a matching flex purge to clear from cache will either be <a href="https://developers.cloudflare.com/cache/concepts/retention-vs-freshness/#retention"><u>naturally evicted</u></a>, or forced to cache MISS and get refreshed from the origin. With this approach, we just needed a distribution and storage system for keeping track of flexible purges.</p>
    <div>
      <h3>Purge looks a lot like a nail</h3>
      <a href="#purge-looks-a-lot-like-a-nail">
        
      </a>
    </div>
    <p>At Cloudflare there is a lot of configuration data that needs to go “everywhere”: cache configuration, load balancer settings, firewall rules, host metadata — countless products, features, and services that depend on configuration data that’s managed through Cloudflare’s control plane APIs. This data needs to be accessible by every machine in every datacenter in our network. The vast majority of that data is distributed via <a href="https://blog.cloudflare.com/introducing-quicksilver-configuration-distribution-at-internet-scale/"><u>a system introduced several years ago called Quicksilver</u></a>. The system works <i>very, very well</i> (sub-second p99 replication lag, globally). It’s extremely flexible and reliable, and reads are lightning fast. The team responsible for the system has done such a good job that Quicksilver has become a hammer that when wielded, makes everything look like a nail… like flexible purges.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/BFntOlvapsYYjYTcxMs7o/d73ad47b63b9d4893b46aeddc28a8698/image2.png" />
            
            </figure><p><sup><i>Core-based purge request entering a data center and getting backhauled to a core data center where Quicksilver distributes the request to all network data centers (hub and spoke).</i></sup><sup> </sup></p><p>Our first version of the flexible purge system used Quicksilver’s spoke-hub distribution to send purges from a core data center to every other data center in our network. It took less than a second for flexible purges to propagate, and once in a given data center, the purge key lookups in the hot path to force cache misses were in the low hundreds of microseconds. We were quite happy with this system at the time, especially because of the simplicity. Using well-supported internal infrastructure meant we weren’t having to manage database clusters or worry about transport between data centers ourselves, since we got that “for free”. Flexible purge was a new feature set and the performance seemed pretty good, especially since we had no predecessor to compare against.</p>
    <div>
      <h3>Victims of our own success</h3>
      <a href="#victims-of-our-own-success">
        
      </a>
    </div>
    <p>Our first version of flexible purge didn’t start showing cracks for years, but eventually both our network and our customer base grew large enough that our system was reaching the limits of what it could scale to. As mentioned above, we needed to store purge requests beyond our maximum eviction age. Purge requests are relatively small, and compress well, but thousands of customers using the API millions of times a day adds up to quite a bit of storage that Quicksilver needed on each machine to maintain purge history, and all of that storage cut into disk space we could otherwise be using to cache customer content. We also found the limits of Quicksilver in terms of how many writes per second it could handle without replication slowing down. We bought ourselves more runway by putting <a href="https://www.boltic.io/blog/kafka-queue#:~:text=Apache%20Kafka%20Queues%3F-,Apache%20Kafka%20queues,-are%20a%20powerful"><u>Kafka queues</u></a> in front of Quicksilver to buffer and throttle ourselves to even out traffic spikes, and increased batching, but all of those protections introduced latency. We knew we needed to come up with a solution without such a strong correlation between usage and operational costs.</p><p>Another pain point exposed by our growing user base that we mentioned in <a href="https://blog.cloudflare.com/rethinking-cache-purge-architecture/"><u>Part 2</u></a> was the excessive round trip times experienced by customers furthest away from our core data centers. A purge request sent by a customer in Australia would have to cross the Pacific Ocean and back before local customers would see the new content.</p><p>To summarize, three issues were plaguing us:</p><ol><li><p>Latency corresponding to how far a customer was from the centralized ingest point.</p></li><li><p>Latency due to the bottleneck for writes at the centralized ingest point.</p></li><li><p>Storage needs in all data centers correlating strongly with throughput demand.</p></li></ol>
    <div>
      <h3>Coreless purge proves useful</h3>
      <a href="#coreless-purge-proves-useful">
        
      </a>
    </div>
    <p>The first two issues affected all types of purge. The spoke-hub distribution model was problematic for purge-by-URL just as much as it was for flexible purges. So we embarked on the path to peer-to-peer distribution for purge-by-URL to address the latency and throughput issues, and the results of that project were good enough that we wanted to propagate flexible purges through the same system. But doing so meant we’d have to replace our use of Quicksilver; it was so good at what it does (fast/reliable replication network-wide, extremely fast/high read throughput) in large part because of the core assumption of spoke-hub distribution it could optimize for. That meant there was no way to write to Quicksilver from “spoke” data centers, and we would need to find another storage system for our purges.</p>
    <div>
      <h3>Flipping purge on its head</h3>
      <a href="#flipping-purge-on-its-head">
        
      </a>
    </div>
    <p>We decided if we’re going to replace our storage system we should dig into exactly what our needs are and find the best fit. It was time to revisit some of our oldest conclusions to see if they still held true, and one of the earlier ones was that proactively purging content from disk would be difficult to do efficiently given our storage layout.</p><p>But was that true? Or could we make active cache purge fast and efficient (enough)? What would it take to quickly find files on disk based on their metadata? “Indexes!” you’re probably screaming, and for good reason. Indexing files’ hostnames, cache-tags, and URLs would undoubtedly make querying for relevant files trivial, but a few aspects of our network make it less straightforward.</p><p>Cloudflare has hundreds of data centers that see trillions of unique files, so any kind of global index — even ignoring the networking hurdles of aggregation — would suffer the same type of bottlenecking issues with our previous spoke-hub system. Scoping the indices to the data center level would be better, but they vary in size up to several hundred machines. Managing a database cluster in each data center scaled to the appropriate size for the aggregate traffic of all the machines was a daunting proposition; it could easily end up being enough work on its own for a separate team, not something we should take on as a side hustle.</p><p>The next step down in scope was an index per machine. Indexing on the same machine as the cache proxy had some compelling upsides: </p><ul><li><p>The proxy could talk to the index over <a href="https://en.wikipedia.org/wiki/Unix_domain_socket"><u>UDS</u></a> (Unix domain sockets), avoiding networking complexities in the hottest paths.</p></li><li><p>As a sidecar service, the index just had to be running anytime the machine was accepting traffic. If a machine died, so would the index, but that didn’t matter, so there wasn’t any need to deal with the complexities of distributed databases.</p></li><li><p>While data centers were frequently adding and removing machines, machines weren’t frequently adding and removing disks. An index could reasonably count on its maximum size being predictable and constant based on overall disk size.</p></li></ul><p>But we wanted to make sure it was feasible on our machines. We analyzed representative cache disks from across our fleet, gathering data like the number of cached assets per terabyte and the average number of cache-tags per asset. We looked at cache MISS, REVALIDATED, and EXPIRED rates to estimate the required write throughput.</p><p>After conducting a thorough analysis, we were convinced the design would work. With a clearer understanding of the anticipated read/write throughput, we started looking at databases that could meet our needs. After benchmarking several relational and non-relational databases, we ultimately chose <a href="https://github.com/facebook/rocksdb"><u>RocksDB</u></a>, a high-performance embedded key-value store. We found that with proper tuning, it could be extremely good at the types of queries we needed.</p>
    <div>
      <h3>Putting it all together</h3>
      <a href="#putting-it-all-together">
        
      </a>
    </div>
    <p>And so CacheDB was born — a service written in Rust and built on RocksDB, which operates on each machine alongside the cache proxy to manage the indexing and purging of cached files. We integrated the cache proxy with CacheDB to ensure that indices are stored whenever a file is cached or updated, and they’re deleted when a file is removed due to eviction or purging. In addition to indexing data, CacheDB maintains a local queue for buffering incoming purge operations. A background process reads purge operations in the queue, looking up all matching files using the indices, and deleting the matched files from disk. Once all matched files for an operation have been deleted, the process clears the indices and removes the purge operation from the queue.</p><p>To further optimize the speed of purges taking effect, the cache proxy was updated to check with CacheDB — similar to the previous lazy purge approach — when a cache HIT occurs before returning the asset. CacheDB does a quick scan of its local queue to see if there are any pending purge operations that match the asset in question, dictating whether the cache proxy should respond with the cached file or fetch a new copy. This means purges will prevent the cache proxy from returning a matching cached file as soon as a purge reaches the machine, even if there are millions of files that correspond to a purge key, and it takes a while to actually delete them all from disk.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5W0ZIGBBbG5Cnc3DSbCPGT/a1572b0b67d844d4e5b7cc7899d320b1/image3.png" />
            
            </figure><p><sup><i>Coreless purge using CacheDB and Durable Objects to distribute purges without needing to first stop at a core data center.</i></sup></p><p>The last piece to change was the distribution pipeline, updated to broadcast flexible purges not just to every data center, but to the CacheDB service running on every machine. We opted for CacheDB to handle the last-mile fan out of machine to machine within a data center, using <a href="https://www.consul.io/"><u>consul</u></a> to keep each machine informed of the health of its peers. The choice let us keep the Workers largely the same for purge-by-URL (more <a href="https://blog.cloudflare.com/rethinking-cache-purge-architecture/"><u>here</u></a>) and flexible purge handling, despite the difference in termination points.</p>
    <div>
      <h3>The payoff</h3>
      <a href="#the-payoff">
        
      </a>
    </div>
    <p>Our new approach reduced the long tail of the lazy purge, saving 10x storage. Better yet, we can now delete purged content immediately instead of waiting for the lazy purge to happen or expire. This new-found storage will improve cache retention on disk for all users, leading to improved cache HIT ratios and reduced egress from your origin.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6B0kVX9Q6qA2JshmcTZSrt/80a845904adf8ba69c121bb54923959e/image1.png" />
            
            </figure><p><sup><i>The shift from lazy content purging (</i></sup><sup><i><u>left</u></i></sup><sup><i>) to the new Coreless Purge architecture allows us to actively delete content (</i></sup><sup><i><u>right</u></i></sup><sup><i>). This helps reduce storage needs and increase cache retention times across our service.</i></sup></p><p>With the new coreless cache purge, we can now get a purge request into any datacenter, distribute the keys to purge, and instantly purge the content from the cache database. This all occurs in less than 150 milliseconds on P50 for tags, hostnames, and prefix URL, covering all <a href="https://www.cloudflare.com/network/"><u>330 cities</u></a> in <a href="https://blog.cloudflare.com/backbone2024/"><u>120+ countries</u></a>.</p>
    <div>
      <h3>Benchmarks</h3>
      <a href="#benchmarks">
        
      </a>
    </div>
    <p>To measure Instant Purge, we wanted to make sure that we were looking at real user metrics — that these were purges customers were actually issuing and performance that was representative of what we were seeing under real conditions, rather than marketing numbers.</p><p>The time we measure represents the period when a request enters the local datacenter, and ends with when the purge has been executed in every datacenter. When the local data center receives the request, one of the first things we do is to add a timestamp to the purge request. When all data centers have completed the purge action, another timestamp is added to “stop the clock.” Each purge request generates this performance data, and it is then sent to a database for us to measure the appropriate quantiles and to help us understand how we can improve further.</p><p>In August 2024, we took purge performance data and segmented our collected data by region based on where the local data center receiving the request was located.</p><table><tr><td><p><b>Region</b></p></td><td><p><b>P50 Aug 2024 (Coreless)</b></p></td><td><p><b>P50 May 2022 (Core-based)</b></p></td><td><p><b>Improvement</b></p></td></tr><tr><td><p>Africa</p></td><td><p>303ms</p></td><td><p>1,420ms</p></td><td><p>78.66%</p></td></tr><tr><td><p>Asia Pacific Region (APAC)</p></td><td><p>199ms</p></td><td><p>1,300ms</p></td><td><p>84.69%</p></td></tr><tr><td><p>Eastern Europe (EEUR)</p></td><td><p>140ms</p></td><td><p>1,240ms</p></td><td><p>88.70%</p></td></tr><tr><td><p>Eastern North America (ENAM)</p></td><td><p>119ms</p></td><td><p>1,080ms</p></td><td><p>88.98%</p></td></tr><tr><td><p>Oceania</p></td><td><p>191ms</p></td><td><p>1,160ms</p></td><td><p>83.53%</p></td></tr><tr><td><p>South America (SA)</p></td><td><p>196ms</p></td><td><p>1,250ms</p></td><td><p>84.32%</p></td></tr><tr><td><p>Western Europe (WEUR)</p></td><td><p>131ms</p></td><td><p>1,190ms</p></td><td><p>88.99%</p></td></tr><tr><td><p>Western North America (WNAM)</p></td><td><p>115ms</p></td><td><p>1,000ms</p></td><td><p>88.5%</p></td></tr><tr><td><p><b>Global</b></p></td><td><p><b>149ms</b></p></td><td><p><b>1,570ms</b></p></td><td><p><b>90.5%</b></p></td></tr></table><p><sup>Note: Global latency numbers on the core-based measurements (May 2022) may be larger than the regional numbers because it represents all of our data centers instead of only a regional portion, so outliers and retries might have an outsized effect.</sup></p>
    <div>
      <h3>What’s next?</h3>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>We are currently wrapping up the roll-out of the last throughput changes which allow us to efficiently scale purge requests. As that happens, we will revise our rate limits and open up purge by tag, hostname, and prefix to all plan types! We expect to begin rolling out the additional purge types to all plans and users beginning in early <b>2025</b>.</p><p>In addition, in the process of implementing this new approach, we have identified improvements that will shave a few more milliseconds off our single-file purge. Currently, single-file purges have a P50 of 234ms. However, we want to, and can, bring that number down to below 200ms.</p><p>If you want to come work on the world's fastest purge system, check out <a href="http://www.cloudflare.com/careers">our open positions</a>.</p>
    <div>
      <h3>Watch on Cloudflare TV</h3>
      <a href="#watch-on-cloudflare-tv">
        
      </a>
    </div>
    <div>
  
</div><p></p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Performance]]></category>
            <category><![CDATA[Cache]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">11EWaw0wCUNwPTM30w7oUN</guid>
            <dc:creator>Alex Krivit</dc:creator>
            <dc:creator>Tim Kornhammar</dc:creator>
            <dc:creator> Connor Harwood</dc:creator>
        </item>
        <item>
            <title><![CDATA[Building secure websites: a guide to Cloudflare Pages and Turnstile Plugin]]></title>
            <link>https://blog.cloudflare.com/guide-to-cloudflare-pages-and-turnstile-plugin/</link>
            <pubDate>Thu, 07 Mar 2024 14:00:52 GMT</pubDate>
            <description><![CDATA[ Learn how to use Cloudflare Pages and Turnstile to deploy your website quickly and easily while protecting it from bots, without compromising user experience. Follow our tutorial here for a seamless integration ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2K7WFOjmj3tTCZ2C90XOzp/1fd9487aaaf44a7b6f853f82f9e2be5f/image1-26.png" />
            
            </figure><p>Balancing developer velocity and security against bots is a constant challenge. Deploying your changes as quickly and easily as possible is essential to stay ahead of your (or your customers’) needs and wants. Ensuring your website is safe from malicious bots — without degrading user experience with alien hieroglyphics to decipher just to prove that you are a human — is no small feat. With <a href="https://pages.cloudflare.com/">Pages</a> and <a href="https://developers.cloudflare.com/turnstile/">Turnstile</a>, we'll walk you through just how easy it is to have the best of both worlds!</p><p><a href="https://pages.cloudflare.com/">Cloudflare Pages</a> offer a seamless platform for deploying and scaling your websites with ease. You can get started right away with configuring your websites with a quick integration using your git provider, and get set up with unlimited requests, bandwidth, collaborators, and projects.</p><p>Cloudflare Turnstile is Cloudflare’s <a href="https://www.cloudflare.com/products/turnstile/">CAPTCHA alternative solution</a> where your users don’t ever have to solve another puzzle to get to your website, no more stop lights and fire hydrants. You can protect your site without having to put your users through an annoying user experience. If you are already using another CAPTCHA service, we have made it easy for you to <a href="https://developers.cloudflare.com/turnstile/migration/">migrate over to Turnstile</a> with minimal effort needed. Check out the <a href="https://developers.cloudflare.com/turnstile/">Turnstile documentation</a> to get started.</p>
    <div>
      <h3>Alright, what are we building?</h3>
      <a href="#alright-what-are-we-building">
        
      </a>
    </div>
    <p>In this tutorial, we'll walk you through integrating Cloudflare Pages with Turnstile to secure your website against bots. You'll learn how to deploy Pages, embed the Turnstile widget, validate the token on the server side, and monitor Turnstile analytics. Let’s build upon <a href="https://developers.cloudflare.com/pages/tutorials/forms/">this tutorial</a> from Cloudflare’s developer docs, which outlines how to create an HTML form with Pages and Functions. We’ll also show you how to secure it by integrating with Turnstile, complete with client-side rendering and server-side validation, using the <a href="https://developers.cloudflare.com/pages/functions/plugins/turnstile/">Turnstile Pages Plugin</a>!</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4DaVCMwbVOKW17aOgthwZh/f756f3466f64bc4f889a5b9ea497b910/Screenshot-2024-03-07-at-11.52.43.png" />
            
            </figure>
    <div>
      <h3>Step 1: Deploy your Pages</h3>
      <a href="#step-1-deploy-your-pages">
        
      </a>
    </div>
    <p>On the Cloudflare Dashboard, select your account and go to Workers &amp; Pages to create a new Pages application with your git provider. Choose the repository where you cloned the tutorial project or any other repository that you want to use for this walkthrough.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5kZP90IyFiaZzl7fX608Dl/355af9d8c998c19e0c032df65d14c324/image2-23.png" />
            
            </figure><p>The Build settings for this project is simple:</p><ul><li><p><b>Framework preset</b>: None</p></li><li><p><b>Build command</b>: npm install @cloudflare/pages-plugin-turnstile</p></li><li><p><b>Build output directory</b>: public</p></li></ul><p>Once you select “Save and Deploy”, all the magic happens under the hood and voilà! The form is already deployed.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6I301dY7rRKreWxUwEuHs/7ea859c666d3c04b39c139c47d3b1c7f/image8-3.png" />
            
            </figure>
    <div>
      <h3>Step 2: Embed Turnstile widget</h3>
      <a href="#step-2-embed-turnstile-widget">
        
      </a>
    </div>
    <p>Now, let’s navigate to Turnstile and add the newly created Pages site.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5BadX97G4W7s5FUuMx82MV/891f196d7f6840d7773684c13d9173ab/image5-14.png" />
            
            </figure><p>Here are the widget configuration options:</p><ul><li><p><b>Domain</b>: All you need to do is add the domain for the Pages application. In this example, it’s “pages-turnstile-demo.pages.dev”. For each deployment, Pages generates a <a href="https://developers.cloudflare.com/pages/configuration/preview-deployments/">deployment specific preview</a> subdomain. Turnstile covers all subdomains automatically, so your Turnstile widget will work as expected even in your previews. This is covered more extensively in our <a href="https://developers.cloudflare.com/turnstile/reference/domain-management/">Turnstile domain management documentation</a>.</p></li><li><p><b>Widget Mode</b>: There are three types of <a href="https://developers.cloudflare.com/turnstile/reference/widget-types/">widget modes</a> you can choose from.</p></li><li><p><b>Managed</b>: This is the recommended option where Cloudflare will decide when further validation through the checkbox interaction is required to confirm whether the user is a human or a bot. This is the mode we will be using in this tutorial.</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/78AnsttFltsSDTWMXxFjnH/d1ee443938d095a4d44874607c046760/Screenshot-2024-03-07-at-11.54.30.png" />
            
            </figure><ul><li><p><b>Non-interactive</b>: This mode does not require the user to interact and check the box of the widget. It is a non-intrusive mode where the widget is still visible to users but requires no added step in the user experience.</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2EAIzU3P7JhQKFteYXb4Hq/1b39212a5393124a081bef94c7d9a07d/Screenshot-2024-03-07-at-11.55.00.png" />
            
            </figure><ul><li><p><b>Invisible</b>: Invisible mode is where the widget is not visible at all to users and runs in the background of your website.</p></li><li><p><b>Pre-Clearance setting</b>: With a clearance cookie issued by the Turnstile widget, you can configure your website to verify every single request or once within a session. To learn more about <a href="/integrating-turnstile-with-the-cloudflare-waf-to-challenge-fetch-requests">implementing pre-clearance with Turnstile</a>, check out this blog post.</p></li></ul><p>Once you create your widget, you will be given a sitekey and a secret key. The sitekey is public and used to invoke the Turnstile widget on your site. The secret key should be stored safely for security purposes.</p><p>Let’s embed the widget above the Submit button. Your index.html should look like this:</p>
            <pre><code>&lt;!doctype html&gt;
&lt;html lang="en"&gt;
	&lt;head&gt;
		&lt;meta charset="utf8"&gt;
		&lt;title&gt;Cloudflare Pages | Form Demo&lt;/title&gt;
		&lt;meta name="theme-color" content="#d86300"&gt;
		&lt;meta name="mobile-web-app-capable" content="yes"&gt;
		&lt;meta name="apple-mobile-web-app-capable" content="yes"&gt;
		&lt;meta name="viewport" content="width=device-width,initial-scale=1"&gt;
		&lt;link rel="icon" type="image/png" href="https://www.cloudflare.com/favicon-128.png"&gt;
		&lt;link rel="stylesheet" href="/index.css"&gt;
		&lt;script src="https://challenges.cloudflare.com/turnstile/v0/api.js?onload=_turnstileCb" defer&gt;&lt;/script&gt;
	&lt;/head&gt;
	&lt;body&gt;

		&lt;main&gt;
			&lt;h1&gt;Demo: Form Submission&lt;/h1&gt;

			&lt;blockquote&gt;
				&lt;p&gt;This is a demonstration of Cloudflare Pages with Turnstile.&lt;/p&gt;
				&lt;p&gt;Pages deployed a &lt;code&gt;/public&lt;/code&gt; directory, containing a HTML document (this webpage) and a &lt;code&gt;/functions&lt;/code&gt; directory, which contains the Cloudflare Workers code for the API endpoint this &lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt; references.&lt;/p&gt;
				&lt;p&gt;&lt;b&gt;NOTE:&lt;/b&gt; On form submission, the API endpoint responds with a JSON representation of the data. There is no JavaScript running in this example.&lt;/p&gt;
			&lt;/blockquote&gt;

			&lt;form method="POST" action="/api/submit"&gt;
				&lt;div class="input"&gt;
					&lt;label for="name"&gt;Full Name&lt;/label&gt;
					&lt;input id="name" name="name" type="text" /&gt;
				&lt;/div&gt;

				&lt;div class="input"&gt;
					&lt;label for="email"&gt;Email Address&lt;/label&gt;
					&lt;input id="email" name="email" type="email" /&gt;
				&lt;/div&gt;

				&lt;div class="input"&gt;
					&lt;label for="referers"&gt;How did you hear about us?&lt;/label&gt;
					&lt;select id="referers" name="referers"&gt;
						&lt;option hidden disabled selected value&gt;&lt;/option&gt;
						&lt;option value="Facebook"&gt;Facebook&lt;/option&gt;
						&lt;option value="Twitter"&gt;Twitter&lt;/option&gt;
						&lt;option value="Google"&gt;Google&lt;/option&gt;
						&lt;option value="Bing"&gt;Bing&lt;/option&gt;
						&lt;option value="Friends"&gt;Friends&lt;/option&gt;
					&lt;/select&gt;
				&lt;/div&gt;

				&lt;div class="checklist"&gt;
					&lt;label&gt;What are your favorite movies?&lt;/label&gt;
					&lt;ul&gt;
						&lt;li&gt;
							&lt;input id="m1" type="checkbox" name="movies" value="Space Jam" /&gt;
							&lt;label for="m1"&gt;Space Jam&lt;/label&gt;
						&lt;/li&gt;
						&lt;li&gt;
							&lt;input id="m2" type="checkbox" name="movies" value="Little Rascals" /&gt;
							&lt;label for="m2"&gt;Little Rascals&lt;/label&gt;
						&lt;/li&gt;
						&lt;li&gt;
							&lt;input id="m3" type="checkbox" name="movies" value="Frozen" /&gt;
							&lt;label for="m3"&gt;Frozen&lt;/label&gt;
						&lt;/li&gt;
						&lt;li&gt;
							&lt;input id="m4" type="checkbox" name="movies" value="Home Alone" /&gt;
							&lt;label for="m4"&gt;Home Alone&lt;/label&gt;
						&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/div&gt;
				&lt;div id="turnstile-widget" style="padding-top: 20px;"&gt;&lt;/div&gt;
				&lt;button type="submit"&gt;Submit&lt;/button&gt;
			&lt;/form&gt;
		&lt;/main&gt;
	&lt;script&gt;
	// This function is called when the Turnstile script is loaded and ready to be used.
	// The function name matches the "onload=..." parameter.
	function _turnstileCb() {
	    console.debug('_turnstileCb called');

	    turnstile.render('#turnstile-widget', {
	      sitekey: '0xAAAAAAAAAXAAAAAAAAAAAA',
	      theme: 'light',
	    });
	}
	&lt;/script&gt;
	&lt;/body&gt;
&lt;/html&gt;</code></pre>
            <p>You can embed the Turnstile widget implicitly or explicitly. In this tutorial, we will explicitly embed the widget by injecting the JavaScript tag and related code, then specifying the placement of the widget.</p>
            <pre><code>&lt;script src="https://challenges.cloudflare.com/turnstile/v0/api.js?onload=_turnstileCb" defer&gt;&lt;/script&gt;</code></pre>
            
            <pre><code>&lt;script&gt;
	function _turnstileCb() {
	    console.debug('_turnstileCb called');

	    turnstile.render('#turnstile-widget', {
	      sitekey: '0xAAAAAAAAAXAAAAAAAAAAAA',
	      theme: 'light',
	    });
	}
&lt;/script&gt;</code></pre>
            <p>Make sure that the <code>div id</code> you assign is the same as the <code>id</code> you specify in <code>turnstile.render</code> call. In this case, let’s use <code>“turnstile-widget”</code>. Once that’s done, you should see the widget show up on your site!</p>
            <pre><code>&lt;div id="turnstile-widget" style="padding-top: 20px;"&gt;&lt;/div&gt;</code></pre>
            
    <div>
      <h3>Step 3: Validate the token</h3>
      <a href="#step-3-validate-the-token">
        
      </a>
    </div>
    <p>Now that the Turnstile widget is rendered on the front end, let’s validate it on the server side and check out the Turnstile outcome. We need to make a call to the <code>/siteverify</code> API with the token in the submit function under <code>./functions/api/submit.js</code>.</p><p>First, grab the token issued from Turnstile under cf-turnstile-response. Then, call the <code>/siteverify</code> API to ensure that the token is valid. In this tutorial, we’ll attach the Turnstile outcome to the response to verify everything is working well. You can decide on the expected behavior and where to direct the user based on the <code>/siteverify</code> response.</p>
            <pre><code>/**
 * POST /api/submit
 */

import turnstilePlugin from "@cloudflare/pages-plugin-turnstile";

// This is a demo secret key. In prod, we recommend you store
// your secret key(s) safely. 
const SECRET_KEY = '0x4AAAAAAASh4E5cwHGsTTePnwcPbnFru6Y';

export const onRequestPost = [
    turnstilePlugin({
    	secret: SECRET_KEY,
    }),
    (async (context) =&gt; {
    	// Request has been validated as coming from a human
    	const formData = await context.request.formData()

    	var tmp, outcome = {};
	for (let [key, value] of formData) {
		tmp = outcome[key];
		if (tmp === undefined) {
			outcome[key] = value;
		} else {
			outcome[key] = [].concat(tmp, value);
		}
	}

	// Attach Turnstile outcome to the response
	outcome["turnstile_outcome"] = context.data.turnstile;

	let pretty = JSON.stringify(outcome, null, 2);

      	return new Response(pretty, {
      		headers: {
      			'Content-Type': 'application/json;charset=utf-8'
      		}
      	});
    })
];</code></pre>
            <p>Since Turnstile accurately decided that the visitor was not a bot, the response for “success” is “true” and “interactive” is “false”. The “interactive” being “false” means that the checkbox was automatically checked by Cloudflare as the visitor was determined to be human. The user was seamlessly allowed access to the website without having to perform any additional actions. If the visitor looks suspicious, Turnstile will become interactive, requiring the visitor to actually click the checkbox to verify that they are not a bot. We used the managed mode in this tutorial but depending on your application logic, you can choose the widget mode that works best for you.</p>
            <pre><code>{
  "name": "Sally Lee",
  "email": "sallylee@cloudflare.com",
  "referers": "Facebook",
  "movies": "Space Jam",
  "cf-turnstile-response": "0._OHpi7JVN7Xz4abJHo9xnK9JNlxKljOp51vKTjoOi6NR4ru_4MLWgmxt1rf75VxRO4_aesvBvYj8bgGxPyEttR1K2qbUdOiONJUd5HzgYEaD_x8fPYVU6uZPUCdWpM4FTFcxPAnqhTGBVdYshMEycXCVBqqLVdwSvY7Me-VJoge7QOStLOtGgQ9FaY4NVQK782mpPfgVujriDAEl4s5HSuVXmoladQlhQEK21KkWtA1B6603wQjlLkog9WqQc0_3QMiBZzZVnFsvh_NLDtOXykOFK2cba1mLLcADIZyhAho0mtmVD6YJFPd-q9iQFRCMmT2Sz00IToXz8cXBGYluKtxjJrq7uXsRrI5pUUThKgGKoHCGTd_ufuLDjDCUE367h5DhJkeMD9UsvQgr1MhH3TPUKP9coLVQxFY89X9t8RAhnzCLNeCRvj2g-GNVs4-MUYPomd9NOcEmSpklYwCgLQ.jyBeKkV_MS2YkK0ZRjUkMg.6845886eb30b58f15de056eeca6afab8110e3123aeb1c0d1abef21c4dd4a54a1",
  "turnstile_outcome": {
    "success": true,
    "error-codes": [],
    "challenge_ts": "2024-02-28T22:52:30.009Z",
    "hostname": "pages-turnstile-demo.pages.dev",
    "action": "",
    "cdata": "",
    "metadata": {
      "interactive": false
    }
  }
}</code></pre>
            
    <div>
      <h3>Wrapping up</h3>
      <a href="#wrapping-up">
        
      </a>
    </div>
    <p>Now that we've set up Turnstile, we can head to Turnstile analytics in the <a href="https://dash.cloudflare.com/?to=/:account/turnstile">Cloudflare Dashboard</a> to monitor the <a href="https://developers.cloudflare.com/turnstile/reference/tooltips/">solve rate</a> and widget traffic. Visitor Solve Rate indicates the percentage of visitors who successfully completed the Turnstile widget. A sudden drop in the Visitor Solve Rate could indicate an increase in bot traffic, as bots may fail to complete the challenge presented by the widget. API Solve Rate measures the percentage of visitors who successfully validated their token against the <code>/siteverify</code> API. Similar to the Visitor Solve Rate, a significant drop in the API Solve Rate may indicate an increase in bot activity, as bots may fail to validate their tokens. Widget Traffic provides insights into the nature of the traffic hitting your website. A high number of challenges requiring interaction may suggest that bots are attempting to access your site, while a high number of unsolved challenges could indicate that the Turnstile widget is effectively blocking suspicious traffic.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6LS7efg5RG5VVEE9VVh41n/0c4f7feaeb2c693ea47df2229efa2091/image6-4.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4rZfKrfY91tTRuCvJgFFHU/3a689f0b7a066d2d85fb09725859bd20/image9-1.png" />
            
            </figure><p>And that’s it! We’ve walked you through how to easily secure your Pages with Turnstile. Pages and Turnstile are currently available for free for every Cloudflare user to get started right away. If you are looking for a seamless and speedy developer experience to get a secure website up and running, protected by Turnstile, head over to the <a href="https://dash.cloudflare.com/?to=/:account/turnstile">Cloudflare Dashboard</a> today!</p> ]]></content:encoded>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[Turnstile]]></category>
            <category><![CDATA[CAPTCHA]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Cloudflare Pages]]></category>
            <category><![CDATA[Bots]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">1XOUeKfqYNFTbbeERuAxAg</guid>
            <dc:creator>Sally Lee</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare is free of CAPTCHAs; Turnstile is free for everyone]]></title>
            <link>https://blog.cloudflare.com/turnstile-ga/</link>
            <pubDate>Fri, 29 Sep 2023 13:00:00 GMT</pubDate>
            <description><![CDATA[ Now that we’ve eliminated CAPTCHAs at Cloudflare, we want to hasten the demise of CAPTCHAs across the internet. We’re thrilled to announce that Turnstile is generally available, and Turnstile’s ‘Managed’ mode is now completely free to everyone for unlimited use.  ]]></description>
            <content:encoded><![CDATA[ <p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2562yydO3PNFG88W5iTE0P/ee8cda8c9929f566e738c0e0f75b2a9b/image3-37.png" />
            
            </figure><p>For years, we’ve <a href="/moving-from-recaptcha-to-hcaptcha/">written</a> that CAPTCHAs drive us crazy. Humans give up on CAPTCHA puzzles <a href="https://www.math.unipd.it/~gaggi/doc/ads20.pdf">approximately 15% of the time</a> and, maddeningly, <a href="https://www.usenix.org/conference/usenixsecurity23/presentation/searles">CAPTCHAs are significantly easier for bots</a> to solve than they are for humans. We’ve spent the past three and a half years working to build a better experience for humans that’s just as effective at stopping bots. As of this month, we’ve finished replacing every CAPTCHA issued by Cloudflare with Turnstile, our new <a href="https://www.cloudflare.com/products/turnstile/">CAPTCHA replacement</a> (pictured below). Cloudflare will never issue another visual puzzle to anyone, for any reason.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/10LzRAr38KzxAANQIVxwZT/0fe5ec0867c70f8217a6deff4b244f9b/image2.gif" />
            
            </figure><p>Now that we’ve eliminated CAPTCHAs at Cloudflare, we want to make it easy for anyone to do the same, even if they don’t use other Cloudflare services. We’ve decoupled Turnstile from our platform so that any website operator on any platform can use it just by adding <a href="https://github.com/cloudflare/turnstile-demo-workers/blob/main/src/explicit.html#L74-L85">a few lines of code</a>. We’re thrilled to announce that Turnstile is now generally available, and <b>Turnstile’s ‘Managed’ mode is now completely free to everyone for unlimited use</b>.</p>
    <div>
      <h3>Easy on humans, hard on bots, private for everyone</h3>
      <a href="#easy-on-humans-hard-on-bots-private-for-everyone">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6DQmrvGrrHUPlLMHrknjyY/99ea339af6278970204cb33bcdf5520f/image6-5.png" />
            
            </figure><p>There’s a lot that goes into Turnstile’s simple checkbox to ensure that it’s easy for everyone, preserves user privacy, and does its job stopping <a href="https://www.cloudflare.com/learning/bots/what-is-a-bot/">bots</a>. Part of making challenges better for everyone means that everyone gets the same great experience, no matter what browser you’re using. Because we do not employ a visual puzzle, users with low vision or blindness get the same easy to use challenge flow as everyone else.</p><p>It was particularly important for us to avoid falling back to audio CAPTCHAs to offer an experience accessible to everyone. Audio CAPTCHAs are often much worse than even visual CAPTCHAs for humans to solve, with only <a href="https://web.stanford.edu/~jurafsky/burszstein_2010_captcha.pdf">31.2% of audio challenges</a> resulting in a three-person agreement on what the correct solution actually is. The prevalence of free speech-to-text services has made it easy for bots to solve audio CAPTCHAs as well, with <a href="https://uncaptcha.cs.umd.edu/papers/uncaptcha_woot17.pdf">a recent study</a> showing bots can accurately solve audio CAPTCHAs in over 85% of attempts. We’re proud to state that Turnstile is WCAG 2.1 Level AA compliant, while eliminating the need for audio CAPTCHAs as well as visual ones.</p><p>We also created Turnstile to be privacy focused. Turnstile meets <a href="https://www.cloudflare.com/learning/privacy/what-is-eprivacy-directive/">ePrivacy Directive</a>, <a href="https://www.cloudflare.com/learning/privacy/what-is-the-gdpr/">GDPR</a> and <a href="https://www.cloudflare.com/learning/privacy/what-is-the-ccpa/">CCPA</a> compliance requirements, as well as the strict requirements of our own privacy commitments. In addition, Cloudflare's <a href="https://marketplace.fedramp.gov/products/FR2000863987">FedRAMP Moderate authorized package</a>, "Cloudflare for Government" now includes Turnstile. We don’t rely on tracking user data, like what other websites someone has visited, to determine if a user is a human or robot. Our business is protecting websites, not selling ads, so operators can deploy Turnstile knowing that their users’ data is safe.</p><p>With all of our emphasis on how <i>easy</i> it is to pass a Turnstile challenge, you would be right to ask how it can stop a bot. If a bot can find <a href="https://www.vox.com/22436832/captchas-getting-harder-ai-artificial-intelligence">all images with crosswalks</a> in grainy photos faster than we can, surely it can check a box as well. Bots definitely can check a box, and they can even <a href="https://arxiv.org/abs/1903.01003">mimic the erratic path of human mouse movement</a> while doing so. For Turnstile, the actual act of checking a box isn’t important, it’s the background data we’re analyzing while the box is checked that matters. We find and stop bots by running a series of in-browser tests, checking browser characteristics, native browser APIs, and asking the browser to pass lightweight tests (ex: proof-of-work tests, proof-of-space tests) to prove that it’s an actual browser. The current deployment of Turnstile checks billions of visitors every day, and we are able to identify browser abnormalities that bots exhibit while attempting to pass those tests.</p><p>For over one year, <a href="/end-cloudflare-captcha/">we used our Managed Challenge</a> to rotate between CAPTCHAs and our own Turnstile challenge to compare our effectiveness. We found that <b>even without asking users for any interactivity at all</b>, Turnstile was just as effective as a CAPTCHA. Once we were sure that the results were effective at coping with the response from bot makers, we replaced the CAPTCHA challenge with our own checkbox solution. We present this extra test when we see potentially suspicious signals, and it helps us provide an even greater layer of security.</p>
    <div>
      <h3>Turnstile is great for fighting fraud</h3>
      <a href="#turnstile-is-great-for-fighting-fraud">
        
      </a>
    </div>
    <p>Like all sites that offer services for free, Cloudflare sees our fair share of automated account signups, which can include “new account fraud,” where bad actors automate the creation of many different accounts to abuse our platform. To help combat this abuse, we’ve rolled out Turnstile’s invisible mode to protect our own signup page. This month, we’ve blocked <b>over</b> <b>1 million automated signup attempts</b> using Turnstile, without a reported false positive or any change in our self-service billings that rely on this signup flow.  </p>
    <div>
      <h3>Lessons from the Turnstile beta</h3>
      <a href="#lessons-from-the-turnstile-beta">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6Fiihb5s0WfTPdtLrqx4ro/7b93471efb6a16ba777e5249405ee726/image5-11.png" />
            
            </figure><p>Over the past twelve months, we’ve been grateful to see how many people are eager to try, then rely on, and integrate Turnstile into their web applications. It’s been rewarding to see the developer community embrace Turnstile as well. We list some of the community created Turnstile integrations <a href="https://developers.cloudflare.com/turnstile/community-resources/">here</a>, including integrations with <a href="https://www.cloudflare.com/integrations/wordpress/">WordPress</a>, Angular, Vue, and a Cloudflare recommended <a href="https://www.npmjs.com/package/@marsidev/react-turnstile">React library</a>. We’ve listened to customer feedback, and added support for <a href="https://developers.cloudflare.com/turnstile/reference/supported-languages/">17 new languages</a>, <a href="https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/">new callbacks</a>, and <a href="https://developers.cloudflare.com/turnstile/reference/client-side-errors/">new error codes</a>.</p><p>76,000+ users have signed up, but our biggest single test by far was the <a href="/how-cloudflare-scaled-and-protected-eurovision-2023-voting/">Eurovision final vote</a>. Turnstile runs on challenge pages on over 25 million Cloudflare websites. Usually, that makes Cloudflare the far and away biggest Turnstile consumer, until the final Eurovision vote. During that one hour, challenge traffic from the Eurovision voting site outpaced the use of challenge pages on those 25 million sites combined! Turnstile handled the enormous spike in traffic without a hitch.</p><p>While a lot went well during the Turnstile beta, we also encountered some opportunities for us to learn. We were initially resistant to disclosing why a Turnstile challenge failed. After all, if bad actors know what we’re looking for, it becomes easier for bots to fool our challenges until we introduce new detections. However, during the Turnstile beta, we saw a few scenarios where legitimate users could not pass a challenge. These scenarios made it clear to us that we need to be transparent about why a challenge failed to help aid any individual who might modify their browser in a way that causes them to get caught by Turnstile. We now publish detailed client-side error codes to surface the reason why a challenge has failed. Two scenarios came up on several occasions that we didn’t expect:</p><p>First, we saw that desktop computers at least 10 years old frequently had expired motherboard batteries, and computers with bad motherboard batteries very often keep inaccurate time. This is because without the motherboard battery, a desktop computer’s clock will stop operating when the computer is off. Turnstile checks your computer’s system time to detect when a website operator has accidentally configured a challenge page to be cached, as caching a challenge page will cause it to become impassable. Unfortunately, this same check was unintentionally catching humans who just needed to update the time. When we see this issue, we now surface a clear error message to the end user to update their system time. We’d prefer to never have to surface an error in the first place, so we’re working to develop new ways to check for cached content that won’t impact real people.</p><p>Second, we find that a few privacy-focused users often ask their browsers to go beyond standard practices to preserve their anonymity. This includes changing their user-agent (something bots will do to evade detection as well), and preventing third-party scripts from executing entirely. Issues caused by this behavior can now be displayed clearly in a Turnstile widget, so those users can immediately understand the issue and make a conscientious choice about whether they want to allow their browser to pass a challenge.</p><p>Although we have some of the most sensitive, thoroughly built monitoring systems at Cloudflare, we did not catch either of these issues on our own. We needed to talk to users affected by the issue to help us understand what the problem was. Going forward, we want to make sure we always have that direct line of communication open. We’re rolling out a new feedback form in the Turnstile widget, to ensure any future corner cases are addressed quickly and with urgency.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/cydzYwhoIVTnaMCPmrYVV/f7ff6163cf69dee1abe00f7b5421cd8f/Screenshot-2023-09-29-at-11.37.58.png" />
            
            </figure>
    <div>
      <h3>Turnstile: GA and Free for Everyone</h3>
      <a href="#turnstile-ga-and-free-for-everyone">
        
      </a>
    </div>
    <p>Announcing Turnstile’s General Availability means that Turnstile is now completely production ready, available for free for unlimited use via our visible widget in Managed mode. Turnstile Enterprise includes SaaS platform support and a visible mode without the Cloudflare logo. Self-serve customers can expect a pay-as-you-go option for advanced features to be available in early 2024. Users can continue to access Turnstile’s advanced features below our 1 million siteverify request limit, as has been the case during the beta. If you’ve been waiting to try Turnstile, head over to our <a href="https://www.cloudflare.com/products/turnstile/">signup page</a> and create an account!</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Turnstile]]></category>
            <category><![CDATA[CAPTCHA]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Bots]]></category>
            <guid isPermaLink="false">3ijPrY6Heu8jsF4JTYQtx6</guid>
            <dc:creator>Benedikt Wolters</dc:creator>
            <dc:creator>Maxime Guerreiro</dc:creator>
            <dc:creator>Adam Martinetti</dc:creator>
        </item>
        <item>
            <title><![CDATA[Connection coalescing with ORIGIN Frames: fewer DNS queries, fewer connections]]></title>
            <link>https://blog.cloudflare.com/connection-coalescing-with-origin-frames-fewer-dns-queries-fewer-connections/</link>
            <pubDate>Mon, 04 Sep 2023 13:00:51 GMT</pubDate>
            <description><![CDATA[ In this blog we’re going to take a closer look at “connection coalescing”, with specific focus on manage it at a large scale ]]></description>
            <content:encoded><![CDATA[ <p><i>This blog reports and summarizes the contents of a Cloudflare </i><a href="https://research.cloudflare.com/publications/Singanamalla2022/"><i>research paper</i></a><i> which appeared at the ACM </i><a href="https://conferences.sigcomm.org/imc/2022/program/"><i>Internet Measurement Conference</i></a><i>, that measures and prototypes connection coalescing with ORIGIN Frames.</i></p><p>Some readers might be surprised to hear that a single visit to a web page can cause a browser to make tens, sometimes even hundreds, of web connections. Take this very blog as an example. If it is your first visit to the Cloudflare blog, or it has been a while since your last visit, your browser will make multiple connections to render the page. The browser will make DNS queries to find IP addresses corresponding to blog.cloudflare.com and then subsequent requests to retrieve any necessary subresources on the web page needed to successfully render the complete page. How many? Looking below, at the time of writing, there are 32 different hostnames used to load the Cloudflare Blog. That means 32 DNS queries and <i>at least</i> 32 TCP (or QUIC) connections, unless the client is able to reuse (or coalesce) some of those connections.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5iVEUq8ZQ8HsPbg1FAP5jq/de5899ea338a7628e732558caf2f8710/Screenshot-2023-09-03-at-18.34.41.png" />
            
            </figure><p>Each new web connection not only introduces additional load on a server's processing capabilities – potentially leading to scalability challenges during peak usage hours – but also exposes client metadata to the network, such as the plaintext hostnames being accessed by an individual. Such meta information can potentially reveal a user’s online activities and browsing behaviors to on-path network adversaries and eavesdroppers!</p><p>In this blog we’re going to take a closer look at “connection coalescing”. Since our initial look at <a href="/connection-coalescing-experiments/">IP-based coalescing in 2021</a>, we have done further large-scale measurements and modeling across the Internet, to understand and predict if and where coalescing would work best. Since IP coalescing is difficult to manage at large scale, last year we implemented and experimented with a promising standard called the <a href="https://datatracker.ietf.org/doc/rfc8336/">HTTP/2 ORIGIN Frame extension</a> that we leveraged to coalesce connections to our edge without worrying about managing IP addresses.</p><p>All told, there are opportunities being missed by many large providers. We hope that this blog (and our <a href="https://research.cloudflare.com/publications/Singanamalla2022/">publication</a> at ACM IMC 2022 with full details) offers a first step that helps servers and clients take advantage of the ORIGIN Frame standard.</p>
    <div>
      <h3>Setting the stage</h3>
      <a href="#setting-the-stage">
        
      </a>
    </div>
    <p>At a high level, as a user navigates the web, the browser renders web pages by retrieving dependent subresources to construct the complete web page. This process bears a striking resemblance to the way physical products are assembled in a factory. In this sense, a modern web page can be considered like an assembly plant. It relies on a ‘supply chain’ of resources that are needed to produce the final product.</p><p>An assembly plant in the physical world can place a single order for different parts and get a single shipment from the supplier (similar to the <a href="https://www.sciencedirect.com/science/article/abs/pii/092552739290109K">kitting process</a> for maximizing value and minimizing response time); no matter the manufacturer of those parts or where they are made -- one ‘connection’ to the supplier is all that is needed. Any single truck from a supplier to an assembly plant can be filled with parts from multiple manufacturers.</p><p>The design of the web causes browsers to typically do the opposite in nature. To retrieve the images, JavaScript, and other resources on a web page (the parts), web clients (assembly plants) have to make <i>at least</i> one connection to every hostname (the manufacturers) defined in the HTML that is returned by the server (the supplier). It makes no difference if the connections to those hostnames go to the same server or not, for example they could go to a <a href="https://www.cloudflare.com/learning/cdn/glossary/reverse-proxy/">reverse proxy</a> like Cloudflare. For each manufacturer a ‘new’ truck would be needed to transfer the materials to the assembly plant from the same supplier, or more formally, a new connection would need to be made to request a subresource from a hostname on the same web page.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3jdJ2PTbkKJKMFxbWD6RgD/40b366c9315d9c55e2409e1654bc0a3d/pasted-image-0--4-.png" />
            
            </figure><p>Without connection coalescing</p><p>The number of connections used to load a web page can be surprisingly high. It is also common for the subresources to need yet other sub-subresources, and so new connections emerge as a result of earlier ones. Remember, too, that HTTP connections to hostnames are often preceded by DNS queries! Connection coalescing allows us to use fewer connections_, or ‘reuse’ the same set of trucks to carry parts from multiple manufacturers from a single supplier._</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/jJx6aGfQCngN6w6D4jpeE/1dcfe2b5e3f8128d8837512ec1a959c9/pasted-image-0--5-.png" />
            
            </figure><p>With connection coalescing </p>
    <div>
      <h3>Connection coalescing in principle</h3>
      <a href="#connection-coalescing-in-principle">
        
      </a>
    </div>
    <p>Connection coalescing was <a href="https://datatracker.ietf.org/doc/html/rfc7540">introduced in HTTP/2</a>, and carried over into <a href="https://www.rfc-editor.org/rfc/rfc9114.html#name-connection-reuse">HTTP/3</a>. We’ve blogged about connection coalescing <a href="/connection-coalescing-experiments/">previously</a> (for a detailed primer we encourage going over that blog). While the idea is simple, implementing it can present a number of engineering challenges. For example, recall from above that there are 32 hostnames (at the time of writing) to load the web page you are reading right now. Among the 32 hostnames are 16 unique domains (defined as “Effective <a href="https://www.cloudflare.com/learning/dns/top-level-domain/">TLD+1</a>”). Can we create fewer connections or ‘coalesce’ existing connections for each unique domain? The answer is ‘<i>Yes, but it depends</i>’.</p><p>The exact number of connections to load the blog page is not at all obvious, and hard to know. There may be 32 hostnames attached to 16 domains but, counter-intuitively, this does not mean the answer to “how many unique connections?” is 16. The true answer could be as few as <i>one</i> connection if all the hostnames are reachable at a single server; or as many as 32 independent connections if a different and distinct server is needed to access each individual hostname.</p><p>Connection reuse comes in many forms, so it’s important to define “connection coalescing” in the HTTP space. For example, the reuse of an existing <a href="https://www.cloudflare.com/learning/ddos/glossary/tcp-ip/">TCP</a> or TLS connection to a hostname to make multiple requests for subresources from that <b><i>same</i></b> hostname is connection reuse, but not coalescing.</p><p>Coalescing occurs when an existing TLS channel for some hostname can be repurposed or used for connecting to a <b><i>different</i></b> hostname. For example, upon visiting blog.cloudflare.com, the HTML points to subresources at cdnjs.cloudflare.com. To reuse the same TLS connection for the subresources, it is necessary for both hostnames to appear together in the TLS certificate's <a href="https://en.wikipedia.org/wiki/Subject_Alternative_Name">“Server Alternative Name (SAN)</a>” list, but this step alone is not sufficient to convince browsers to coalesce. After all, the cdnjs.cloudflare.com service may or may not be reachable at the same server as blog.cloudflare.com, despite being on the same certificate. So how can the browser know? Coalescing only works if servers set up the right conditions, but clients have to decide whether to coalesce or not – thus, browsers require a signal to coalesce beyond the SANs list on the certificate. Revisiting our analogy, the assembly plant may order a part from a manufacturer directly, not knowing that the supplier already has the same part in its warehouse.</p><p>There are two explicit signals a browser can use to decide whether connections can be coalesced: one is IP-based, the other ORIGIN Frame-based. The former requires the server operators to tightly bind DNS records to the HTTP resources available on the server. This is difficult to manage and deploy, and actually creates a risky dependency, because you have to place all the resources behind a specific set or a single IP address. The way IP addresses influence coalescing decisions <a href="https://daniel.haxx.se/blog/2016/08/18/http2-connection-coalescing/">varies among browsers</a>, with some choosing to be more conservative and others more permissive. Alternatively, the HTTP ORIGIN Frame is an easier signal for the servers to orchestrate; it’s also flexible and has graceful failure with no interruption to service (for a specification compliant implementation).</p><p>A foundational difference between both these coalescing signals is: IP-based coalescing signals are implicit, even accidental, and force clients to infer coalescing possibilities that may exist, or not. None of this is surprising since IP addresses are designed to <a href="/addressing-agility/">have no real relationship with names!</a> In contrast, ORIGIN Frame is an explicit signal from servers to clients that coalescing is available no matter what DNS says for any particular hostname.</p><p>We have experimented with <a href="/connection-coalescing-experiments/">IP-based coalescing previously</a>; for the purpose of this blog we will take a deeper look at ORIGIN Frame-based coalescing.</p>
    <div>
      <h3>What is the ORIGIN Frame standard?</h3>
      <a href="#what-is-the-origin-frame-standard">
        
      </a>
    </div>
    <p>The ORIGIN Frame is an extension to the <a href="https://www.rfc-editor.org/rfc/rfc8336">HTTP/2</a> and <a href="https://www.rfc-editor.org/rfc/rfc9412">HTTP/3</a> specification, a special Frame sent on stream 0 or the control stream of the connection respectively. The Frame allows the servers to send an ‘origin-set’ to the clients on an <i>existing</i> established TLS connection, which includes hostnames that it is authorized for and will not incur any <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/421">HTTP 421 errors</a>. Hostnames in the origin-set MUST also appear in the certificate SAN list for the server, even if those hostnames are announced on different IP addresses via DNS.</p><p>Specifically, two different steps are required:</p><ol><li><p>Web servers must send a list enumerating the Origin Set (the hostnames that a given connection might be used for) in the ORIGIN Frame extension.</p></li><li><p>The TLS certificate returned by the web server must cover the additional hostnames being returned in the ORIGIN Frame in the DNS names SAN entries.</p></li></ol><p>At a high-level ORIGIN Frames are a supplement to the TLS certificate that operators can attach to say, “Psst! Hey, client, here are the names in the SANs that are available on this connection -- you can coalesce!” Since the ORIGIN Frame is not part of the certificate itself, its contents can be made to change independently. No new certificate is required. There is also no dependency on IP addresses. For a coalesceable hostname, existing TCP/QUIC+TLS connections can be reused without requiring new connections or DNS queries.</p><p><a href="https://w3techs.com/technologies/overview/proxy">Many websites today</a> rely on content which is served by CDNs, like Cloudflare CDN service. The practice of using external CDN services offers websites the advantages of speed, reliability, and reduces the load of content served by their <a href="https://www.cloudflare.com/learning/cdn/glossary/origin-server/">origin servers</a>. When both the website, and the resources are served by the same CDN, despite being different hostnames, owned by different entities, it opens up some very interesting opportunities for CDN operators to allow connections to be reused and coalesced since they can control both the certificate management and connection requests for sending ORIGIN frames on behalf of the real origin server.</p><p>Unfortunately, there has been no way to turn the possibilities enabled by ORIGIN Frame into practice. To the best of our knowledge, until today, there has been no server implementation that supports ORIGIN Frames. Among browsers, only Firefox supports ORIGIN Frames. Since IP coalescing is challenging and ORIGIN Frame has no deployed support, is the engineering time and energy to better support coalescing worth the investment? We decided to find out with a large-scale Internet-wide measurement to understand the opportunities and predict the possibilities, and then implemented the ORIGIN Frame to experiment on production traffic.</p>
    <div>
      <h3>Experiment #1: What is the scale of required changes?</h3>
      <a href="#experiment-1-what-is-the-scale-of-required-changes">
        
      </a>
    </div>
    <p>In February 2021, <a href="/connection-coalescing-experiments/">we collected data</a> for 500K of the <a href="https://radar.cloudflare.com/domains">most popular websites</a> on the Internet, using a modified <a href="https://github.com/WPO-Foundation/webpagetest">Web Page Test</a> on 100 virtual machines. An automated Chrome (v88) browser instance was launched for every visit to a web page to eliminate caching effects (because we wanted to understand coalescing, not caching). On successful completion of each session, Chrome developer tools were used to retrieve and write the page load data as an HTTP Archive format (HAR) file with a full timeline of events, as well as additional information about certificates and their validation. Additionally, we parsed the certificate chains for the root web page and new TLS connections triggered by subresource requests to (i) identify certificate issuers for the hostnames, (ii) inspect the presence of the Subject Alternative Name (SAN) extension, and (iii) validate that DNS names resolve to the IP address used. Further details about our methodology and results can be found in the technical <a href="https://research.cloudflare.com/publications/Singanamalla2022/">paper</a>.</p><p>The first step was to understand what resources are requested by web pages to successfully render the page contents, and where these resources were present on the Internet. Connection coalescing becomes possible when subresource domains are ideally co-located. We approximated the location of a domain by finding its corresponding autonomous system (AS). For example, the domain attached to <a href="https://cdnjs.cloudflare.com/https://cdnjs.cloudflare.com/">cdnjs</a> is reachable via AS 13335 in the BGP routing table, and that AS number belongs to Cloudflare. The figure below describes the percentage of web pages and the number of unique ASes needed to fully load a web page.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3H188I6GyYxiqZEYxBPMPp/4bde6b40a523d0e66207c87cee40755c/Screenshot-2023-08-31-at-1.39.16-PM.png" />
            
            </figure><p>Around 14% of the web pages need two ASes to fully load i.e. pages that have a dependency on one additional AS for subresources. More than 50% of the web pages need to contact no more than six ASes to obtain all the necessary subresources. This finding as shown in the plot above implies that a relatively small number of operators serve the sub-resource content necessary for a majority (~50%) of the websites, and any usage of ORIGIN Frames would need only a few changes to have its intended impact. The potential for connection coalescing can therefore be optimistically approximated to the number of unique ASes needed to retrieve all subresources in a web page. In practice however, this may be superseded by operational factors such as SLAs or helped by flexible mappings between sockets, names, and IP addresses which we worked on <a href="https://research.cloudflare.com/publications/Fayed2021/">previously at Cloudflare</a>.</p><p>We then tried to understand the impact of coalescing on connection metrics. The measured and ideal number of DNS queries and TLS connections needed to load a web page are summarized by their CDFs in the figure below.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7aCaLsYdjNqeuQAuVSfQ6c/beae2aeaf3e96830f9562c09aeb0a2cd/Screenshot-2023-08-31-at-1.39.02-PM.png" />
            
            </figure><p>Through modeling and extensive analysis, we identify that connection coalescing through ORIGIN Frames could reduce the number of DNS and TLS connections made by browsers by over 60% at the median. We performed this modeling by identifying the number of times the clients requested DNS records, and combined them with the ideal ORIGIN Frames to serve.</p><p>Many multi-origin servers such as those operated by <a href="https://www.cloudflare.com/learning/cdn/what-is-a-cdn/">CDNs</a> tend to reuse certificates and serve the same certificate with multiple DNS SAN entries. This allows the operators to manage fewer certificates through their creation and renewal cycles. While theoretically one can have millions of names in the certificate, creating such certificates is unreasonable and a challenge to manage effectively. By continuing to rely on existing certificates, our modeling measurements bring to light the volume of changes required to enable perfect coalescing, while presenting information about the scale of changes needed, as highlighted in the figure below.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5rIcRVeD6UEGNCW9dj3MYM/187f0bc53e9afedf3baca072410eb4db/Screenshot-2023-08-31-at-1.38.35-PM.png" />
            
            </figure><p>We identify that over 60% of the certificates served by websites do not need any modifications and could benefit from ORIGIN Frames, while with no more than 10 additions to the DNS SAN names in certificates we’re able to successfully coalesce connections to over 92% of the websites in our measurement. The most effective changes could be made by CDN providers by adding three or four of their most popular requested hostnames into each certificate.</p>
    <div>
      <h3>Experiment #2: ORIGIN Frames in action</h3>
      <a href="#experiment-2-origin-frames-in-action">
        
      </a>
    </div>
    <p>In order to validate our modeling expectations, we then took a more active approach in early 2022. Our next experiment focused on 5,000 websites that make extensive use of <i>cdnjs.cloudflare.com</i> as a subresource. By modifying our experimental TLS termination endpoint we deployed HTTP/2 ORIGIN Frame support as defined in the <a href="https://datatracker.ietf.org/doc/rfc8336/">RFC standard</a>. This involved changing the internal fork of <i>net</i> and <i>http</i> dependency modules of Golang which we have open sourced (<a href="https://github.com/cloudflare/go-originframe">see here</a>, and <a href="https://github.com/cloudflare/net-originframe">here</a>).</p><p>During the experiments, connecting to a website in the experiment set would return <i>cdnjs.cloudflare.com</i> in the ORIGIN frame, while the control set returned an arbitrary (unused) hostname. All existing edge certificates for the 5000 websites were also modified. For the experimental group, the corresponding certificates were renewed with <i>cdnjs.cloudflare.com</i> added to the SAN. To ensure integrity between control and experimental sets, control group domains certificates were also renewed with a valid and identical size third party domain used by none of the control domains. This is done to ensure that the relative size changes to the certificates is kept constant avoiding potential biases due to different certificate sizes. Our results were striking!</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2jGJXHliykd9CGh3lNujpq/bc1b9faf871d7d4c6ecf7041966078cb/Screenshot-2023-08-31-at-1.38.47-PM.png" />
            
            </figure><p>Sampling 1% of the requests we received from Firefox to the websites in the experiment, we identified over <b>50% reduction in new TLS connections per second</b> indicating a lesser number of cryptographic verification operations done by both the client and reduced server compute overheads. As expected there were no differences in the control set indicating the effectiveness of connection re-use as seen by the CDN or server operators.</p>
    <div>
      <h3>Discussion and insights</h3>
      <a href="#discussion-and-insights">
        
      </a>
    </div>
    <p>While our modeling measurements indicated that we could anticipate some performance improvements, in practice it was not significantly better suggesting that ‘no-worse’ is the appropriate mental model regarding performance. The subtle interplay between resource object sizes, competing connections, and congestion control is subject to network conditions. Bottleneck-share capacity, for example, diminishes as fewer connections compete for bottleneck resources on network links. It would be interesting to revisit these measurements as more operators deploy support on their servers for ORIGIN Frames.</p><p>Apart from performance, one major benefit of ORIGIN frames is in terms of privacy. How? Well, each coalesced connection hides client metadata that is otherwise leaked from non-coalesced connections. Certain resources on a web page are loaded depending on how one is interacting with the website. This means for every new connection for retrieving some resource from the server, TLS plaintext metadata like <a href="https://www.cloudflare.com/learning/ssl/what-is-sni/">SNI</a> (in the absence of <a href="/encrypted-client-hello/">Encrypted Client Hello</a>) and at least one plaintext DNS query, if transmitted over UDP or TCP on port 53, is exposed to the network. Coalescing connections helps remove the need for browsers to open new TLS connections, and the need to do extra DNS queries. This prevents metadata leakage from anyone listening on the network. ORIGIN Frames help minimize those signals from the network path, improving privacy by reducing the amount of cleartext information leaked on path to network eavesdroppers.</p><p>While the browsers benefit from reduced cryptographic computations needed to verify multiple certificates, a major advantage comes from the fact that it opens up very interesting future opportunities for resource scheduling at the endpoints (the browsers, and the origin servers) such as <a href="/better-http-3-prioritization-for-a-faster-web/">prioritization</a>, or recent proposals like <a href="/early-hints/">HTTP early hints</a> to provide clients experiences where connections are not overloaded or competing for those resources. When coupled with <a href="https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-http2-secondary-certs-06#section-3.4">CERTIFICATE Frames</a> IETF draft, we can further eliminate the need for manual certificate modifications as a server can prove its authority of hostnames after connection establishment without any additional SAN entries on the website’s TLS certificate.</p>
    <div>
      <h3>Conclusion and call to action</h3>
      <a href="#conclusion-and-call-to-action">
        
      </a>
    </div>
    <p>In summary, the current Internet ecosystem has a lot of opportunities for connection coalescing with only a few changes to certificates and their server infrastructure. Servers can significantly reduce the number of TLS handshakes by roughly 50%, while reducing the number of render blocking DNS queries by over 60%. Clients additionally reap these benefits in privacy by reducing cleartext DNS exposure to network on-lookers.</p><p>To help make this a reality we are currently planning to add support for both HTTP/2 and HTTP/3 ORIGIN Frames for our customers. We also encourage other operators that manage third party resources to adopt support of ORIGIN Frame to improve the Internet ecosystem.Our paper submission was accepted to the ACM Internet Measurement Conference 2022 and is <a href="https://research.cloudflare.com/publications/Singanamalla2022/">available for download</a>. If you’d like to work on projects like this, where you get to see the rubber meet the road for new standards, visit our <a href="https://www.cloudflare.com/careers/">careers page</a>!</p> ]]></content:encoded>
            <category><![CDATA[DNS]]></category>
            <category><![CDATA[Internship Experience]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[HTTP2]]></category>
            <category><![CDATA[TLS]]></category>
            <category><![CDATA[Research]]></category>
            <guid isPermaLink="false">QjYiQB1Bf6uRL71yURBMi</guid>
            <dc:creator>Suleman Ahmad</dc:creator>
            <dc:creator>Jonathan Hoyland</dc:creator>
            <dc:creator>Sudheesh Singanamalla</dc:creator>
        </item>
        <item>
            <title><![CDATA[Welcome to Speed Week 2023]]></title>
            <link>https://blog.cloudflare.com/welcome-to-speed-week-2023/</link>
            <pubDate>Sun, 18 Jun 2023 17:00:40 GMT</pubDate>
            <description><![CDATA[ This week we will help you measure what matters. We’ll help you gain insight into your performance, from Zero Trust and API’s to websites and applications. And finally we’ll help you get faster. Quickly ]]></description>
            <content:encoded><![CDATA[ <p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/hIjlYUV0oiHkvLU7BPDwE/9081023429a9851730f99e14b484d4f8/image2-3.png" />
            
            </figure><p>What we consider ‘fast’ is changing. In just over a century we’ve cut the <a href="https://www.independent.co.uk/travel/news-and-advice/uk-australia-flight-time-travel-100-years-change-london-perth-direct-a8268311.html">time</a> taken to travel to the other side of the world from 28 days to 17 hours. We developed a vaccine for a virus causing a global pandemic in just <a href="https://wellcome.org/news/quick-safe-covid-vaccine-development">one year</a> - 10% of the typical time. <a href="https://www.cloudflare.com/learning/ai/what-is-artificial-intelligence/">AI</a> has reduced the time taken to complete software development tasks by <a href="https://github.blog/2022-09-07-research-quantifying-github-copilots-impact-on-developer-productivity-and-happiness/">55%</a>. As a society, we are driven by metrics - and the need to beat what existed before.</p><p>At Cloudflare we don't focus on metrics of days gone by. We’re not aiming for “faster horses”. Instead we are driven by questions such as “What does it actually look like for users?”, “How is this actually speeding up the Internet?”, and “How does this make the customer faster?”.</p><p>This innovation week we are helping users measure what matters. We will cover a range of topics including how we are fastest at Zero Trust, have the fastest network and a deep dive on cache purge and why global purge latency mightn’t be the gold star it's made out to be. We’ll also cover why Time to First Byte is generally a bad measurement. And what you should care about instead.</p><p>Woven amongst these topics are a number of great new products and features that genuinely make you and your customers faster. From API acceleration and end-to-end Brotli 11 compression, to reducing page load times by 30% with one-click. Plus a brand new home for application performance.</p><p>This week we will help you measure what matters. We’ll help you gain insight into your performance, from <a href="https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/">Zero Trust</a> and APIs to websites and applications. And finally we’ll help you get faster. Quickly.</p><p>We are proving we are the fastest at what we do. And we are making it as easy as possible for our users to attain those numbers.</p><p>Welcome to Speed Week.</p>
    <div>
      <h3>More megapixels?</h3>
      <a href="#more-megapixels">
        
      </a>
    </div>
    <p>You don't have to go far in the real world to find examples of highly-touted metrics that likely don't capture what you really care about.</p><p>If you read the announcements each year you’d be forgiven for believing smartphones have devolved into cameras with apps and an antenna. With each new model announced the press releases reference megapixel improvements between the previous and latest model.</p><p>The number of megapixels alone does not guarantee better image quality. Factors such as sensor size, lens quality, image processing algorithms, and low-light performance also play significant roles in determining the overall camera performance. This has been a widely accepted view for over a <a href="https://www.scientificamerican.com/article/camera-megapixels-why-more-isnt-alw-2012-05/">decade now</a>, so why do companies keep pushing it as a metric - and why do users feel it's important?</p><p>Similarly, marketing collateral from Internet Service Providers would have you believe that “bandwidth is king”.</p><p>However it has been categorically proven that <a href="/making-home-internet-faster/">bandwidth is not the sole indicator of speed</a>. Just two months ago we published a blog on “Making home Internet faster has little to do with speed”, concluding “While bandwidth plays a part, the latency of the connection – the real Internet “speed” – is more important_<b>”</b>_. The post references a recent paper by two researchers from MIT which supports this point, showing the point of diminishing returns is around 20Mbps for when more bandwidth doesn't mean a webpage loads much faster.</p><p>Again, the advertised, and generally accepted comparison metric amongst consumers, is incorrect. More bandwidth does not equal faster Internet speeds.</p><p>Simply put - are you really measuring what matters to you when reviewing your product choices and vendors? Or on reflection have your choices been influenced by dogma for far too long?</p>
    <div>
      <h3>Measuring what matters on the Internet</h3>
      <a href="#measuring-what-matters-on-the-internet">
        
      </a>
    </div>
    <p>Similarly to the smartphone and ISP industries, we at Cloudflare operate in industries where users often compare us against competitors using metrics that likely don't measure what matters to them.</p><p>Large enterprises use software to selectively shift traffic between Content Delivery Networks (CDNs) based on the lowest possible Time to First Byte (TTFB) score per region. This means if Cloudflare suddenly were to cut its TTFB in half in Africa, for example, we could see a huge influx of traffic in this region from these enterprise customers - likely not doing anything to improve the actual visitor experience of a website.</p><p>TTFB is often used as a measure of how quickly a web server responds to a request and common web testing services report it. The faster it is the better the web server (in theory). We have known for <a href="/ttfb-time-to-first-byte-considered-meaningles/">years</a>, however, that TTFB is not on its own a fair reflection of real world performance.</p><p>Receiving the first byte isn't sufficient to determine a good end user experience as most pages have additional render blocking resources that get loaded after the initial document request. TTFB does not take into account multiplexing benefits of HTTP/2 and HTTP/3 which allow browsers to load files in parallel. It also doesn't account for features like <a href="https://developers.cloudflare.com/cache/advanced-configuration/early-hints/">Early Hints</a>, <a href="https://www.cloudflare.com/products/zaraz/">Zaraz</a>, <a href="https://developers.cloudflare.com/fundamentals/speed/rocket-loader/">Rocket Loader</a>, <a href="/better-http-2-prioritization-for-a-faster-web/">HTTP/2</a> and soon HTTP/3 Prioritization which eliminate render blocking.</p><p>As Sitespect wrote <a href="https://www.sitespect.com/ttfb-is-not-the-best-indicator-of-site-speed/">last year</a>, “<i>TTFB is a measure of how fast a web server is able to respond to a request, and how long it takes for that request to traverse various layers of networking to reach a user’s browser. It is a measure of speed for delivery of content, but it is not a measurement for how long end-users are effectively waiting before they can start interacting with your website. TTFB completely ignores everything that happens after that network layer: loading, downloading of resources, rendering, etc. In other words, TTFB is not a user-centric measurement, it’s a networking measurement.</i>”.</p><p>At Cloudflare we are all-in on <b>Real User Monitoring (RUM)</b> as the future of website performance. We’re investing heavily in it - both from an observation point of view and from an optimization one also. This week we will be releasing a series of new products aimed at helping users understand the actual experience of their end users (i.e. website visitors), and provide suggestions on how to improve it.</p><p>For those unfamiliar with RUM, we typically optimize websites for three main metrics - known as the “Core Web Vitals”. This is a set of key metrics which are believed to be the best and most accurate representation of a poorly performing website vs a well performing one. These key metrics are <i>Largest Contentful Paint, First Input Delay and Cumulative Layout Shift.</i></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/66g3R1QaW4F8fVgpwqhx6N/4b035620185c026fc8f0f1f0a1244838/image1-3.png" />
            
            </figure><p>Credit: <a href="https://addyosmani.com/blog/web-vitals-extension/">https://addyosmani.com/blog/web-vitals-extension/</a></p><p>LCP measures loading performance; typically how long it takes to load the largest image or text block visible in the browser. FID measures interactivity. For example, the time between when a user clicks or taps on a button to when the browser responds and starts doing something. Finally, CLS measures visual stability. A good, or bad example of CLS is when you go to a website on your mobile phone, tap on a link and the page moves at the last second meaning you tap something you didn't want to. That would be a lower CLS score as its poor user experience.</p><p>Looking at these metrics gives us a good idea of how the end user is truly experiencing your website (RUM) vs. how quickly the nearest Cloudflare data center begins to return data (TTFB).</p><p>The other benefit of Real User Monitoring is it includes the speed advantage of new protocols and features designed to improve the customer experience. For example, Time to First Byte is a single connection between the client and the nearest Cloudflare server. This is nothing like how a web browser connects to a website, which uses multiplexing to fetch multiple files at the same time in parallel. There are also products like Early Hints which are designed to take advantage of the “server think time” to send instructions to the browser to begin loading readily-available resources while the server finishes compiling the full response.</p><p>In Speed Week we will be going deep into why TTFB is a bad metric to care about for websites and web applications, why RUM is the future, and a blog post on the latest Core Web Vital - “Interaction to Next Paint” (INP), and what it means to you as a business.</p><p>We will also be unveiling a brand-new product which will be the new home of application performance on Cloudflare. The new product will augment synthetic tests from various global locations with <a href="https://www.cloudflare.com/application-services/solutions/app-performance-monitoring/">real user monitoring data</a> to give administrators the best possible understanding of how their website is performing <i>in the real world.</i> This product will be available for all plan levels.</p>
    <div>
      <h3>We’re the fastest, and we can prove it</h3>
      <a href="#were-the-fastest-and-we-can-prove-it">
        
      </a>
    </div>
    <p>It's no secret that Cloudflare is fast.</p><p>However it might not be obvious to the everyday reader just how fast we are, and in just how many areas.  Fastest <a href="/network-performance-update-developer-week/">compute</a>. Fastest <a href="https://www.dnsperf.com/#!dns-providers">DNS</a>. Fastest <a href="/network-performance-update-developer-week/">network</a>. Fastest <a href="/network-performance-update-security-week-2023/">Zero Trust Network Access (ZTNA)</a>. Fastest Secure Web Gateway (SWG). Fastest o<a href="https://www.cloudflare.com/learning/cloud/what-is-object-storage/">bject storage</a>. And we’re finding areas we are not empirically the fastest and looking to prove we are number one.</p><p>We’re also finding ways to migrate customers from legacy providers and applications to Cloudflare as fast as possible. These legacy vendors have locked in companies using confusing terminology and esoteric features, trapping them on sub-par products and making them too afraid to move away. We’re helping those customers escape. <a href="/r2-super-slurper-ga/">Super Slurper</a> helps customers move away from S3, Turpentine helps migrate legacy VCL setups to Cloudflare, and our <a href="/descaler-program/">Descaler program</a> helps to migrate customers from Zscaler to Cloudflare in a matter of hours. We are building tools and products to help those customers who want to move to the fastest network but are locked in.</p><p>In Speed Week we’ll cover the latest on these programs and how we are relentlessly pushing to make the migration process as quick and easy as possible for customers who want to move to Cloudflare and put their business on the fastest network around.</p>
    <div>
      <h3>Performance matters, whatever the product area</h3>
      <a href="#performance-matters-whatever-the-product-area">
        
      </a>
    </div>
    <p>Generally when you hear of performance improvements it's typically through the lens making websites faster. But speed comes in many forms. Take Zero Trust as an example.</p><p>Measuring Zero Trust performance matters because it impacts your employees' experience and their ability to get their job done. Whether it’s accessing services through access control products, connecting out to the public Internet through a Secure Web Gateway, or securing risky external sites through Remote Browser Isolation, all of these experiences need to be frictionless. But what if your company's Secure Web Gateway is in London and you are in Johannesburg? This can mean a painful, slow, and frustrating employee experience whilst they wait for traffic to be sent to and from London. Slack becomes slow. Zoom becomes slow. Employees become frustrated.</p><p>The bigger concern, however, is not knowing of these performance issues. For example, if each of your employees are physically located in an office and the connection to critical business systems like Salesforce or Workday worsens, the likelihood is it will become evident quickly. But what about in a remote workforce with employees globally distributed? As a business, you need the ability to understand how your employees are experiencing critical business systems and identify any connection and performance issues they may be experiencing to ensure they get addressed quickly. In Speed Week we’ll unveil our latest Zero Trust offering which will give CIOs and businesses incredible insight into the performance experience of their workforce.</p><p>Speed Week will show Cloudflare is the fastest Zero Trust provider. Our analysis will provide updated benchmark comparisons and include additional competitors to show how we outperform everyone to give employees the fastest Zero Trust experience.</p><p>Another area we will shine a spotlight on this week is <i>cache purge</i>. When you think of CDNs it's common to look at them as a large distributed cache. Visitor-requested files are retrieved from an origin and stored on globally distributed CDN servers. This allows visitors to download the file in the quickest possible time by retrieving it from their nearest Cloudflare data center rather than having to traverse the Internet to and from the origin. TTFB will measure the time taken to receive a single file from the nearest location. RUM will measure the time it takes to receive multiple files, cached and uncached, and put them together into the webpage requested. But what about when the file changes on origin?</p><p>In the scenario where a business is hosting a pricebook as a downloadable file on its website, it is very important to understand how long it takes to remove old copies from Cloudflare cache to ensure customers don't see incorrect prices. This is where measuring <i>cache purge times</i> becomes important. The time taken to remove the invalidated file (old file) from every server in every data center in the CDN is known as the ‘global purge time’. In Speed Week we will explain how we have built our new cache purge architecture to be lightning-fast and what the performance numbers are as a result (spoiler: they are insanely fast).</p><p>These are just a few examples of what we have in store for the week. We also have blogs on AI, API acceleration, developer platform, networking, protocols, compression, streaming, UI optimization and more.</p>
    <div>
      <h3>Speed at the heart of Cloudflare</h3>
      <a href="#speed-at-the-heart-of-cloudflare">
        
      </a>
    </div>
    <p>At Cloudflare we put performance at the heart of everything we do.</p><p>Make sure to follow the Cloudflare blog and social media accounts for all of the week's news, and join us on Cloudflare TV each day for a live discussion of the day's announcements.</p><p>Welcome to Speed Week.</p>
    <div>
      <h3>Watch on Cloudflare TV</h3>
      <a href="#watch-on-cloudflare-tv">
        
      </a>
    </div>
    <div></div><p></p> ]]></content:encoded>
            <category><![CDATA[Speed Week]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">54vXpUAi08KLT7ihBbqJB0</guid>
            <dc:creator>Sam Marsh</dc:creator>
        </item>
        <item>
            <title><![CDATA[Understand the impact of Waiting Room settings with Waiting Room Analytics]]></title>
            <link>https://blog.cloudflare.com/understand-the-impact-of-your-waiting-rooms-settings-with-waiting-room-analytics/</link>
            <pubDate>Wed, 07 Jun 2023 13:00:44 GMT</pubDate>
            <description><![CDATA[ Today, we are thrilled to announce the launch of Waiting Room Analytics and tell you more about how we built this game-changing feature. Waiting Room Analytics provides insights into end-user experience and visualizations of your waiting room traffic ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3y5ATrfMtMfpdbyB9kJlz8/bb381e09b5d22635ecf09255a37d9041/download--1--3.png" />
            
            </figure><p>In January 2021, we gave you a behind-the-scenes look at how we built <a href="/building-waiting-room-on-workers-and-durable-objects/">Waiting Room on Cloudflare’s Durable Objects</a>. Today, we are thrilled to announce the launch of Waiting Room Analytics and tell you more about how we built this feature. Waiting Room Analytics offers insights into end-user experience and provides visualizations of your waiting room traffic. These new metrics enable you to make well-informed configuration decisions, ensuring an optimal end-user experience while protecting your site from overwhelming traffic spikes.</p><p>If you’ve ever bought tickets for a popular concert online you’ll likely have been put in a virtual queue. That’s what Waiting Room provides. It keeps your site up and running in the face of overwhelming traffic surges. Waiting Room sends excess visitors to a customizable virtual waiting room and admits them to your site as spots become available.</p><p>While customers have come to rely on the protection Waiting Room provides against traffic surges, they have faced challenges analyzing their waiting room’s performance and impact on end-user flow. Without feedback about waiting room traffic as it relates to waiting room settings, it was challenging to make Waiting Room configuration decisions.</p><p>Up until now, customers could only monitor their waiting room's status endpoint to get a general idea of waiting room traffic. This endpoint displays the current number of queued users, active users on the site, and the estimated wait time shown to the last user in line.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3fOglidb4tQ5LGfkrUOPu4/f085a0622740f08ca10a6483d950c1ed/a1.png" />
            
            </figure><p>The status endpoint is still a great tool for at a glance understanding of the near real-time status of a waiting room. However, there were many questions customers had about their waiting room that were either difficult or impossible to answer using the status endpoint, such as:</p><ul><li><p>How long did visitors wait in the queue?</p></li><li><p>What was my peak number of visitors?</p></li><li><p>How long was the pre-queue for my online event?</p></li><li><p>How did changing my waiting room's settings impact wait times?</p></li></ul><p>Today, Waiting Room is ready to answer those questions and more with the launch of Waiting Room Analytics, available in the Waiting Room dashboard to all Business and Enterprise plans! We will show you the new waiting room metrics available and review how these metrics can help you make informed decisions about your waiting room's settings. We'll also walk you through the unique challenge of how we built Waiting Room Analytics on our distributed network.</p>
    <div>
      <h2>How Waiting Room settings impact traffic</h2>
      <a href="#how-waiting-room-settings-impact-traffic">
        
      </a>
    </div>
    <p>Before covering the newly available Waiting Room metrics, let's review some key settings you configure when creating a waiting room. Understanding these settings is essential as they directly impact your waiting room's analytics, traffic, and user experience.</p><p>When configuring a waiting room, you will first define traffic limits to your site by setting two values–Total active users and New users per minute. Total active users is a target threshold for how many simultaneous users you want to allow on the pages covered by your waiting room. Waiting Room will kick in as traffic ramps up to keep active users near this limit. The other value which will control the volume of traffic allowed past your waiting room is New users per minute. This setting defines the target threshold for the maximum rate of user influx to your application. Waiting Room will kick in when the influx accelerates to keep this rate near your limits. Queuing occurs when traffic is at or near your New users per minute or Total active users target values.</p><p>The two other settings which will impact your traffic flow and user wait times are Session duration and session renewal. The session duration setting determines how long it takes for end-user sessions to expire, thereby freeing up spots on your site. If you enable session renewal, users can stay on your site as long as they want, provided they make a request once every <i>session_duration</i> minutes. If you disable session renewal, users' sessions will expire after the duration you set for session_duration has run out. After the session expires, the user will be issued a new waiting room cookie upon their next request. If there is active queueing, this user will be placed in the back of the queue. Otherwise, they can continue browsing for another <i>session_duration</i> minutes.</p><p>Let's walk through the new analytics available in the Waiting Room dashboard, which allows you to see how these settings can impact waiting room throughput, how many users get queued, and how long users wait to enter your site from the queue.</p>
    <div>
      <h3>Waiting Room Analytics in the dash</h3>
      <a href="#waiting-room-analytics-in-the-dash">
        
      </a>
    </div>
    <p>To access metrics for a waiting room, navigate to the Waiting Room dashboard, where you can find pre-built visualizations of your waiting room traffic. The dashboard offers at-a-glance metrics for the peak waiting room traffic over the last 24 hours.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6TCj0fwsD4c8wpZ5dhHuw1/4cf9ab0f5845ee600e919b2b11ce78ba/a2.png" />
            
            </figure><p>Get at-a-glance metrics of the last 24 hours of Waiting Room traffic.</p><p>To dig deeper and analyze up to 30 days of historical data, open your waiting room's analytics by selecting View more.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5nveI9Qo2i6q2dS8evggsm/33bbb59edda0ce303b75c3fb5602e682/a3.gif" />
            
            </figure><p>Review up to 30 days of waiting room metrics by selecting View more.</p><p>Alternatively, we've made it easy to hone in on analytics for a past <a href="/waiting-room-event-scheduling/">waiting room event</a> (within the last 30 days). You can automatically open the analytics dashboard to a past event's exact start and end time, including the pre-queueing period by selecting the blue link in the events table.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2Kexln2cQOSi7n27rMgR8V/47445b0c5f1ba495588cc3aa91acf9f2/a4.png" />
            
            </figure><p>To get data tied to a past event, simply select the link in the Waiting Room Events table.</p>
    <div>
      <h4>User insights</h4>
      <a href="#user-insights">
        
      </a>
    </div>
    <p>The first two metrics–Time in queue and Time on origin–provide insights into your end-users' experience and behavior.  The <i>time in queue</i> values help you understand how long queued users waited before accessing your site over the time period selected. The <i>time on origin</i> values shed light on end-user behavior by displaying an estimate of the range of time users spend on your site before leaving. If session renewal is disabled, this time will max out at session_duration and reflect the time at which users are issued a new waiting room cookie. For both metrics, we provide time for both the typical user, represented by a range of the 50th and 75th percentile of users, as well as for the top 5% of users who spend the longest in the queue or on your site.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7xYxDmpcV3mPLEuhtz3ukJ/cca9e9d5f5f82179d5dc8aea74ef0b82/a5.png" />
            
            </figure><p>The Time in queue and Time on origin are given for the typical user as well as for the 95th percentile of users.</p><p>If session renewal is disabled, keeping an eye on Time on origin values is especially important. When sessions do not renew, once a user's session has expired, they are given a new waiting room cookie upon their next request. The user will be put at the back of the line if there is active queueing. Otherwise, they will continue browsing, but their session timer will start over and your analytics will never show a Time on origin greater than your configured session duration, even if individual users are on your site longer than the session duration. If session renewal is disabled and the typical time on origin is close to your configured session duration, this could be an indicator you may need to give your users more time to complete their journey before putting them back in line.</p>
    <div>
      <h4>Analyze past waiting room traffic</h4>
      <a href="#analyze-past-waiting-room-traffic">
        
      </a>
    </div>
    <p>Scrolling down the page, you will find visualizations of your user traffic compared to your waiting room's target thresholds for Total active users and New users per minute. These two settings determine when your waiting room will start queueing as traffic increases. The Total active users setting controls the number of concurrent users on your site, while the New users per minute threshold restricts the flow rate of users onto your site.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/15dYn07CaChldpZOoTqLvq/3fc7a2f9c653e44dbca630ff0cddaf4b/a6.gif" />
            
            </figure><p><i>To zoom in on a time period, you can drag your cursor from the left to the right of the time period you are interested in and the other graphs, in addition to the insights will update to reflect this time period.</i></p><p>On the Active users graph, each bar represents the maximum number of queued users stacked on top of the maximum number of users on your site at that point in time. The example below shows how the waiting room kicked in at different times with respect to the active user threshold. The total length of the bar illustrates how many total users were either on the site or waiting to enter the site at that point in time, with a clear divide between those two values where the active user threshold kicked in. Hover over any bar to display a tooltip with the exact values for the period you are interested in.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6GGSRvWJYGx6KxOTALOxZU/e9a95d8519905c2d96855a18a96363df/a7.png" />
            
            </figure><p>Easily identify peak traffic and when waiting room started queuing to protect your site from a traffic surge.</p><p>Below the Active users chart is the New users per minute graph, which shows the rate of users entering your application per minute compared to your configured threshold. Make sure to review this graph to identify any surges in the rate of users to your application that may have caused queueing.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/18ARuNhm8JUrclAZ1qzxHj/be86627ff03979b62b71ef6946114b43/a8.png" />
            
            </figure><p>The New users per minute graph helps you identify peaks in the rate of users entering your site which triggered queueing.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6L7rMLgDdWh4rbyfAwGMdW/1f8f6f3156c988bc2fa93c7f0f0f3c64/a9.png" />
            
            </figure><p>This graph shows queued user and active user data from the same time period as the spike seen in New users per minute graph above. When analyzing your waiting room’s metrics, be sure to review both graphs to understand which Waiting Room traffic setting triggered queueing and to what extent.</p>
    <div>
      <h3>Adjusting settings with Waiting Room Analytics</h3>
      <a href="#adjusting-settings-with-waiting-room-analytics">
        
      </a>
    </div>
    <p>By leveraging the insights provided by the analytics dashboard, you can fine-tune your waiting room settings while ensuring a safe and seamless user experience. A common concern for customers is longer than desired wait times during high traffic periods. We will walk through some guidelines for evaluating peak traffic and settings’ adjustments that could be made.</p><p><b>Identify peak traffic.</b> The first step is to identify when peak traffic occurred. To do so, zoom out to 30 days or some time period inclusive of a known high traffic event. Reviewing the graph, locate a period of time where traffic peaked and use your cursor to highlight from the left to right of the peak. This will zoom in to that time period, updating all other values on the analytics page.</p><p><b>Evaluate wait times.</b> Now that you have honed in on the time period of peak traffic, review the Time in queue metric to analyze if the wait times during peak traffic were acceptable. If you determine that wait times were significantly longer than you had anticipated, consider the following options to reduce wait times for your next traffic peak.</p><p><b>Decrease session duration when session renewal is enabled.</b> This is a safe option as it does not increase the allowed load to your site. By decreasing this duration, you decrease the amount of time it takes for spots to open up as users go idle. This is a good option if your customer journey is typically request heavy, such as a checkout flow. For other situations, such as video streaming or long-form content viewing, this may not be a good option as users may not make frequent requests even though they are not actually idle.</p><p><b>Disable session renewal.</b>  This option also does not increase the allowed load to your site. Disabling session renewal means that users will have <i>session_duration</i> minutes to stay on the site before being put back in the queue. This option is popular for high demand events such as product drops, where customers want to give as many users as possible a fair chance to participate and avoid inventory hoarding. When disabling session renewal, review your waiting room’s analytics to determine an appropriate session duration to set.</p><p>The Time on origin values will give you an idea of how long users need before leaving your site. In the example below, the session duration is set to 10 minutes but even the users who spend the longest only spend around 5 minutes on the site. With the session renewal disabled, this customer could reduce wait times by decreasing the session duration to 5 minutes without disruption to most users, allowing for more users to get access.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/74sEnoEXPq6KHfToDvxG3G/abaa9a81a20dbf326f2cf0b358b639df/a10.png" />
            
            </figure><p><b>Adjust Total active users or New users per minute settings.</b> Lastly, you can decrease wait times by increasing your waiting room’s traffic limits–Total active users or New users per minute. This is the most sure-fire way to reduce wait times but it also requires more consideration. Before increasing either limit, you will need to evaluate if it is safe to do so and make small, iterative adjustments to these limits, monitoring certain signals to ensure your origin is still able to handle the load. A few things to consider monitoring as you adjust settings are origin CPU usage and memory utilization, and increases in 5xx errors which can be reviewed in Cloudflare’s Web Analytics tab. Analyze historical traffic patterns during similar events or periods of high demand. If you observe that previous traffic surges were successfully managed without site instability or crashes, it provides a strong signal that you can consider increasing waiting room limits.</p><p>Utilize the Active user chart as well as the New users per minute chart to determine which limit is primarily responsible for triggering queuing so that you know which limit to adjust. After considering these signals and making adjustments to your waiting room’s traffic limits, closely monitor the impact of these changes using the waiting room analytics dashboard. Continuously assess the performance and stability of your site, keeping an eye on server metrics and user feedback.</p>
    <div>
      <h3>How we built Waiting Room Analytics</h3>
      <a href="#how-we-built-waiting-room-analytics">
        
      </a>
    </div>
    <p>At Cloudflare, we love to build on top of our own products. Waiting Room is built on <a href="/building-waiting-room-on-workers-and-durable-objects/">Workers and Durable Objects</a>. Workers have the ability to auto-scale based on the request rate. They are built using <a href="/cloud-computing-without-containers/">isolates</a> enabling them to spin up hundreds or thousands of isolates within 5 milliseconds without much overhead. Every request that goes to an application behind a waiting room, goes to a Worker.</p><p>We optimized the way in which we track end users visiting the application while maintaining their position in the queue. Tracking every user individually would incur more overhead in terms of maintaining state, consuming more CPU &amp; memory. Instead, we decided to divide the users into buckets based on the timestamp of the first request made by the end user. For example, all the users who visited a waiting room between 00:00:00 and 00:00:59 for the first time are assigned to the bucket 00:00:00. Every end user gets a unique encrypted cookie on the first request to the waiting room. The contents of the cookie keep getting updated based on the status of the users in the queue. Once the end user is accepted to the origin, we set the cookie expiry to <i>session_duration</i> minutes, which can be set in the dashboard, from the last request timestamp. In the cookie we track the timestamp of when the end user joined the queue which is used in the calculation of time waited in queue.</p>
    <div>
      <h4>Collection of metrics in a distributed environment</h4>
      <a href="#collection-of-metrics-in-a-distributed-environment">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5PhNDWwGlL9HyuZhyh5zSK/2efde37fe13c8293cb4d99fd636ec73d/a11.png" />
            
            </figure><p>The Waiting Room is a distributed system that receives requests from multiple locations around the globe</p><p>In a distributed environment, the challenge when building out analytics is to collect data from multiple nodes and aggregate them. Each worker running at every data center sees user requests and needs to report metrics based on those to another coordinating service at every data center. The data aggregation could have been done in two ways.</p><p><b>i) Writing data from every worker when a request is received</b>In this design, every worker that receives a request is responsible for reporting the metrics. This would enable us to write the raw data to our analytics pipeline. We would not have the overhead of aggregating the data before writing. This would mean that we would write data for every request, but Waiting Room configurations are minute based and every user is put into a bucket based on the timestamp of the first request. All our configurations are minute and user based and the data written from workers is not related to time or user.</p><p><b>ii) Using the existing aggregation pipeline</b>Waiting Room is designed in such a way that we do not track every request, instead we group users into buckets based on the first time we saw them. This is tracked in the cookie that is issued to the user when they make the first request. In the current system, the data reported by the workers is sent upstream to the data center coordinator which is responsible for aggregating the data seen from all the workers for that particular data center. This aggregated data is then further processed and sent upstream to the global Durable Object which aggregates the data from all the other data centers. This data is used for making decisions whether to queue the user or to send them to the origin.</p><p>We decided to use the existing pipeline that is used for Waiting Room routing for analytics. Data aggregated this way provides more value to customers as it matches the model we use for routing decisions. Therefore, customers can see directly how changing their settings affects waiting room behavior. Also, it is an optimization in terms of space. Instead of writing analytics data per request, we are writing a pre-processed and aggregated analytics log every minute. This way the data is much less noisy.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6yadAlbwltDgqZeYQwN4nf/ac4e6782682ea83e94e0f171d1b8bf25/a12.png" />
            
            </figure><p>This diagram depicts that multiple workers from different locations receive requests and talk to the data center coordinators respectively which aggregate data and report the aggregated keys upstream to the Global Durable Object. The Global Durable Objects further aggregate all the keys received from the data center coordinators to compute a global aggregate key.</p>
    <div>
      <h3>Histograms</h3>
      <a href="#histograms">
        
      </a>
    </div>
    <p>The metrics available via Cloudflare’s GraphQL API are a combination of configured values set by the customer when creating a waiting room and values that are computed based on traffic seen by a waiting room. Waiting Room aggregates data every minute for each metric based on the requests it sees. While some metrics like <i>new users per minute</i>, <i>total active users</i> are counts and can be pre-processed and aggregated with a simple summation, metrics like <i>time on origin</i> and <i>total time waited in queue</i> cannot simply be added together into a single metric.</p><p>For example, there could be users who waited in the queue for four minutes and there could be a new user who joined the queue two minutes ago. However, if we simply sum these two data points, it would not make sense because six minutes would be an incorrect representation of the total time waited in the queue. Therefore, to capture this value more accurately, we store the data in a histogram. This enables us to represent the typical case (50th percentile) and the approximate worst case (in this case 95th percentile) for that metric.</p><p>Intuitively, we decided to store <i>time on origin</i> and <i>total time waited in queue</i> into a histogram distribution so that we would be able to represent the data and calculate quantiles precisely. We used <a href="http://hdrhistogram.org/">Hdr Histogram</a> - A High Dynamic Range Histogram for recording the data in histograms. Hdr Histograms are scalable and we were able to record dynamic numbers of values with auto-resizing without inflating CPU, memory or introducing latency. The time to record a value in the Hdr Histograms range from 3-6 nanoseconds. Querying and recording values can be done in constant time. Two histogram data structures can simply be added together into a bigger histogram. Also, the histograms can be compressed and encoded/decoded into base64 strings. This enabled us to scalably pass the data structure within our internal services for further aggregation.</p><p>The memory footprint of hdr histograms is constant and depends on the size of the bucket, precision and range of the histogram. The size of the bucket we use is the default 32 bits bucket size. The precision of the histogram is set to include up to three significant digits. The histogram has a dynamic range of values enabled through the use of the auto-resize functionality. However, to ensure efficient data storage, a limit of 5,000 recorded points per minute has been imposed. Although this limit was chosen arbitrarily, it has proven to be adequate for storing data points transmitted from the workers to the Durable Objects on a minute-by-minute basis.</p><p>The requests to the website behind a Waiting Room go to a Cloudflare data center that is close to their <a href="https://www.cloudflare.com/network/">location</a>. Our workers from around the world record values in the histogram which is compressed and sent to the data center Durable Object periodically. The histograms from multiple workers are uncompressed and aggregated into a single histogram per data center. The resulting histogram is compressed and sent upstream to the Global Durable objects where the histograms from all data centers receiving traffic are uncompressed and aggregated. The resulting histogram is the final data structure which is used for statistical analysis. We directly query the aggregated histogram for the quantile values. The histogram objects were instantiated once at the start of the service, they were reset after every successful sync with the upstream service.</p>
    <div>
      <h4>Writing data to the pipeline</h4>
      <a href="#writing-data-to-the-pipeline">
        
      </a>
    </div>
    <p>The global Durable Object aggregates all the metrics, computes quantiles and sends the data to a worker which is responsible for analytics reporting. This worker reads data from Workers KV in order to get the Waiting Room configurations. All the metrics are aggregated into a single analytics message. These messages are written every minute to Clickhouse. We leveraged an internal version of <a href="https://developers.cloudflare.com/analytics/analytics-engine/">Workers Analytics Engine</a> in order to write the data. This allowed us to quickly write our logs to Clickhouse with minimum interactions with all the systems involved in the pipeline.</p><p>We write analytics events from the runtime in the form of blobs and doubles with a specific schema and the event data gets written to a Clickhouse cluster. We extract the data into a Clickhouse view and apply <a href="/explaining-cloudflares-abr-analytics/">ABR</a> to facilitate fast queries at any timescale. You can expand the time range to vary from 30 minutes to 30 days without any lag. ABR adaptively chooses the resolution of data based on the query. For example, it would choose a lower resolution for a long time range and vice versa. As of now, the analytics data is available in the Clickhouse table for 30 days, implying that you can not query data older than 30 days in the dashboard as well.</p>
    <div>
      <h4>Sampling</h4>
      <a href="#sampling">
        
      </a>
    </div>
    <p>Waiting Room Analytics samples the data in order to effectively run large queries while providing consistent response times. Indexing the data on Waiting Room id has enabled us to run quicker and more efficient scans, however we still need to elegantly handle unbounded data. To tackle this we use <a href="/explaining-cloudflares-abr-analytics/">Adaptive Bit Rate</a> which enables us to write the data at multiple resolutions (100%, 10%, 1%...) and then read the best resolution of the data. The sample rate “adapts” based on how long the query takes to run. If the query takes too long to run in 100% resolution, the next resolution is picked and so on until the first successful result. However, since we pre-process and aggregate data before writing to the pipeline, we expect 100% resolution of data on reads for shorter periods of time (up to 7 days). For a longer time range, the data will be sampled.</p>
    <div>
      <h4>Get Waiting Room Analytics via GraphQL API</h4>
      <a href="#get-waiting-room-analytics-via-graphql-api">
        
      </a>
    </div>
    <p>Lastly, to make metrics available to customers and to the Waiting Room dashboard, we exposed the analytics data available in Clickhouse via GraphQL API.</p><p>If you prefer to build your own dashboards or systems based on waiting room traffic data, then Waiting Room Analytics via GraphQL API is for you. Build your own custom dashboards using the GraphQL framework and use a GraphQL client such as GraphiQL to run queries and explore the schema.</p><p>The Waiting Room Analytics dataset can be found under the Zones Viewer as waitingRoomAnalyticsAdaptive and waitingRoomAnalyticsAdaptiveGroups. You can filter the dataset per zone, waiting_room_id and the request time period, see the dataset schema under ZoneWaitingRoomAnalyticsAdaptive. You can order the data by ascending or descending order of the metric values.</p><p>You can explore the dimensions under waitingRoomAnalyticsAdaptiveGroups that can be used to group the data based on time, Waiting Room id and so on. The "max", “min”, “avg”, “sum” functions give the maximum, minimum, average and sum values of a metric aggregated over a time period. Additionally, there is a function called "avgWeighted" that calculates the weighted average of the metric. This approach is used for metrics stored in histograms, such as the time spent on the origin and total time waited. Instead of using a simple average, the weighted average is computed to provide a more accurate representation. This approach takes into account the distribution and significance of different data points, ensuring a more precise analysis and interpretation of the metric.</p><p>For example, to evaluate the weighted average for time spent on origin, the value of <i>total active users</i> is used as a weight. To better illustrate this concept, let’s consider an example. Imagine there is a website behind a Waiting Room and we want to evaluate the average time spent on the origin over a certain time period, let’s say an hour. During this hour, the number of active users on the website fluctuates. At some points, there may be more users actively browsing the site while at other times the number of active users might decrease. To calculate the weighted average for the time spent on the origin, we take into account the number of <i>total active users</i> at each instant in time. The rationale behind this is that the more users are actively using the website, the more representative their time spent on origin becomes in relation to the overall user activity.</p><p>By incorporating the <i>total active users</i> as weights in the calculation, we give more importance to the time spent on the origin during periods when there are more users actively engaging with the website. This provides a more accurate representation of the average time spent on the origin, accounting for variations in user activity throughout the designated time period.</p><p>The value of <i>new users per minute</i> is used as a weight to compute the weighted average for total time waited in queue. This is because when we talk about the total time weighted in the queue, the value of new users per minute for that instant in time takes importance as it signifies the number of users that joined the queue and certainly went into the origin.</p><p>You can apply these aggregation functions to the list of metrics exposed under each function. However, if you just want the logs per minute for a time period, rather than the breakdown of the time period (minute, fifteen minutes, hours), you can remove the datetime dimension from the query. For a list of sample queries to get you started, refer to our <a href="https://developers.cloudflare.com/waiting-room/waiting-room-analytics/#graphql-analytics">dev docs</a>.</p><p>Below is a query to calculate the average, maximum and minimum of <i>total active users, estimated wait time, total queued users and session duration</i> every fifteen minutes. It also calculates the weighted average of <i>time spent in queue</i> and <i>time spent on origin</i>. The query is done on the zone level. The response is obtained in a JSON format.</p><p>Following is an example query to find the weighted averages of time on origin (50th percentile) and total time waited (90th percentile) for a certain period and aggregate this data over one hour.</p>
            <pre><code>{
 viewer {
   zones(filter: {zoneTag: "example-zone"}) {
     waitingRoomAnalyticsAdaptiveGroups(limit: 10, filter: {datetime_geq: "2023-03-15T04:00:00Z", datetime_leq: "2023-03-15T04:45:00Z", waitingRoomId: "example-waiting-room-id"}, orderBy: [datetimeHour_ASC]) {
       avgWeighted {
         timeOnOriginP50
         totalTimeWaitedP90
       }
       dimensions {
         datetimeHour
       }
     }</code></pre>
            <p>Sample Response</p>
            <pre><code>{
  "data": {
    "viewer": {
      "zones": [
        {
          "waitingRoomAnalyticsAdaptiveGroups": [
            {
              "avgWeighted": {
                "timeOnOriginP50": 83.83,
                "totalTimeWaitedP90": 994.45
              },
              "dimensions": {
                "datetimeHour": "2023-05-24T04:00:00Z"
              }
            }
          ]
        }
      ]
    }
  },
  "errors": null
}</code></pre>
            <p>You can find more examples in our developer <a href="https://developers.cloudflare.com/waiting-room/waiting-room-analytics/">documentation</a>.Waiting Room Analytics is live and available to all Business and Enterprise customers and we are excited for you to explore it! Don’t have a waiting room set up? Make sure your site is always protected from unexpected traffic surges. Try out <a href="https://dash.cloudflare.com/?to=/:account/:zone/traffic/waiting-rooms">Waiting Room</a> today!</p> ]]></content:encoded>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Waiting Room]]></category>
            <category><![CDATA[Analytics]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">2rtjX1BlNurlYL9QUV42p7</guid>
            <dc:creator>Arielle Olache</dc:creator>
            <dc:creator>Aditi Paul</dc:creator>
        </item>
        <item>
            <title><![CDATA[Examining HTTP/3 usage one year on]]></title>
            <link>https://blog.cloudflare.com/http3-usage-one-year-on/</link>
            <pubDate>Tue, 06 Jun 2023 13:00:20 GMT</pubDate>
            <description><![CDATA[ With the HTTP/3 RFC celebrating its 1st birthday, we examined HTTP version usage trends between May 2022 - May 2023. We found that HTTP/3 usage by browsers continued to grow, but that search engine and social media bots continued to effectively ignore the latest version of the web’s core protocol ]]></description>
            <content:encoded><![CDATA[ <p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3fGsSPUCSxABWlwpC5HfdV/ca7cf03337e600bd768b8acc7d06de36/image11-1.png" />
            
            </figure><p>In June 2022, after the publication of a set of HTTP-related Internet standards, including the <a href="https://www.rfc-editor.org/rfc/rfc9114.html">RFC that formally defined HTTP/3</a>, we published <a href="/cloudflare-view-http3-usage/"><i>HTTP RFCs have evolved: A Cloudflare view of HTTP usage trends</i></a>. One year on, as the RFC reaches its first birthday, we thought it would be interesting to look back at how these trends have evolved over the last year.</p><p>Our previous post reviewed usage trends for <a href="https://datatracker.ietf.org/doc/html/rfc9112">HTTP/1.1</a>, <a href="https://datatracker.ietf.org/doc/html/rfc9113">HTTP/2</a>, and <a href="https://datatracker.ietf.org/doc/html/rfc9114">HTTP/3</a> observed across Cloudflare’s network between May 2021 and May 2022, broken out by version and browser family, as well as for search engine indexing and social media bots. At the time, we found that browser-driven traffic was overwhelmingly using HTTP/2, although HTTP/3 usage was showing signs of growth. Search and social bots were mixed in terms of preference for <a href="https://www.cloudflare.com/learning/performance/http2-vs-http1.1/">HTTP/1.1 vs. HTTP/2</a>, with little-to-no HTTP/3 usage seen.</p><p>Between May 2022 and May 2023, we found that HTTP/3 usage in browser-retrieved content continued to grow, but that search engine indexing and social media bots continued to effectively ignore the latest version of the web’s core protocol. (Having said that, <a href="https://www.cloudflare.com/learning/performance/what-is-http3/">the benefits of HTTP/3</a> are very user-centric, and arguably offer minimal benefits to bots designed to asynchronously crawl and index content. This may be a key reason that we see such low adoption across these automated user agents.) In addition, HTTP/3 usage across API traffic is still low, but doubled across the year. Support for HTTP/3 is on by default for zones using Cloudflare’s free tier of service, while paid customers have the option to activate support.</p><p>HTTP/1.1 and HTTP/2 use TCP as a transport layer and add security via <a href="https://www.cloudflare.com/learning/ssl/transport-layer-security-tls/">TLS</a>. HTTP/3 uses QUIC to provide both the transport layer and security. Due to the difference in transport layer, user agents usually require learning that an origin is accessible using HTTP/3 before they'll try it. One method of discovery is <a href="https://httpwg.org/specs/rfc7838.html">HTTP Alternative Services</a>, where servers return an Alt-Svc response header containing a list of supported <a href="https://developer.mozilla.org/en-US/docs/Glossary/ALPN">Application-Layer Protocol Negotiation Identifiers (ALPN IDs)</a>. Another method is the <a href="/speeding-up-https-and-http-3-negotiation-with-dns/">HTTPS record type</a>, where clients query the DNS to learn the supported ALPN IDs. The ALPN ID for HTTP/3 is "h3" but while the specification was in development and iteration, we added a suffix to identify the particular draft version e.g., "h3-29" identified <a href="https://datatracker.ietf.org/doc/html/draft-ietf-quic-http-29">draft 29</a>. In order to maintain compatibility for a wide range of clients, Cloudflare advertised both "h3" and "h3-29". However, draft 29 was published close to three years ago and clients have caught up with support for the final RFC. As of late May 2023, Cloudflare no longer advertises h3-29 for zones that have HTTP/3 enabled, helping to save several bytes on each HTTP response or <a href="https://www.cloudflare.com/learning/dns/dns-records/">DNS record</a> that would have included it. Because a browser and web server typically automatically negotiate the highest HTTP version available, HTTP/3 takes precedence over HTTP/2.</p><p>In the sections below, “likely automated” and “automated” traffic based on <a href="https://developers.cloudflare.com/bots/concepts/bot-score/">Cloudflare bot score</a> has been filtered out for desktop and mobile browser analysis to restrict analysis to “likely human” traffic, but it is included for the search engine and social media bot analysis. In addition, references to HTTP requests or HTTP traffic below include requests made over both HTTP and HTTPS.</p>
    <div>
      <h3>Overall request distribution by HTTP version</h3>
      <a href="#overall-request-distribution-by-http-version">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/BD7nhUhMqEAKHE3lw7Ucs/1230d8393a90c5a431398edccac2b6c2/download-3.png" />
            
            </figure><p>Aggregating global web traffic to Cloudflare on a daily basis, we can observe usage trends for HTTP/1.1, HTTP/2, and HTTP/3 across the surveyed one year period. The share of traffic over HTTP/1.1 declined from 8% to 7% between May and the end of September, but grew rapidly to over 11% through October. It stayed elevated into the new year and through January, dropping back down to 9% by May 2023. Interestingly, the weekday/weekend traffic pattern became more pronounced after the October increase, and remained for the subsequent six months. HTTP/2 request share saw nominal change over the year, beginning around 68% in May 2022, but then starting to decline slightly in June. After that, its share didn’t see a significant amount of change, ending the period just shy of 64%. No clear weekday/weekend pattern was visible for HTTP/2. Starting with just over 23% share in May 2022, the percentage of requests over HTTP/3 grew to just over 30% by August and into September, but dropped to around 26% by November. After some nominal loss and growth, it ended the surveyed time period at 28% share. (Note that this graph begins in late May due to data retention limitations encountered when generating the graph in early June.)</p>
    <div>
      <h3>API request distribution by HTTP version</h3>
      <a href="#api-request-distribution-by-http-version">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1iKB6A5jGKVMBcaRAYckjv/47b7777093a2cad492060224a8257601/download--1--2.png" />
            
            </figure><p>Although <a href="/application-security-2023/">API traffic</a> makes up a significant amount of Cloudflare’s request volume, only a small fraction of those requests are made over HTTP/3. Approximately half of such requests are made over HTTP/1.1, with another third over HTTP/2. However, HTTP/3 usage for APIs grew from around 6% in May 2022 to over 12% by May 2023. HTTP/3’s smaller share of traffic is likely due in part to support for HTTP/3 in key tools like <a href="https://curl.se/docs/http3.html">curl</a> still being considered as “experimental”. Should this change in the future, with HTTP/3 gaining first-class support in such tools, we expect that this will accelerate growth in HTTP/3 usage, both for <a href="https://www.cloudflare.com/learning/security/api/what-is-an-api/">APIs</a> and overall as well.</p>
    <div>
      <h3>Mitigated request distribution by HTTP version</h3>
      <a href="#mitigated-request-distribution-by-http-version">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4J6wSXALudeaeZNzxvgRBo/6614895278f32528664d3f1444402350/download--2--2.png" />
            
            </figure><p>The analyses presented above consider all HTTP requests made to Cloudflare, but we also thought that it would be interesting to look at HTTP version usage by potentially malicious traffic, so we broke out just those requests that were mitigated by one of Cloudflare’s application security solutions. The graph above shows that the vast majority of mitigated requests are made over HTTP/1.1 and HTTP/2, with generally less than 5% made over HTTP/3. Mitigated requests appear to be most frequently made over HTTP/1.1, although HTTP/2 accounted for a larger share between early August and late November. These observations suggest that attackers don’t appear to be investing the effort to upgrade their tools to take advantage of the newest version of HTTP, finding the older versions of the protocol sufficient for their needs. (Note that this graph begins in late May 2022 due to data retention limitations encountered when generating the graph in early June 2023.)</p>
    <div>
      <h3>HTTP/3 use by desktop browser</h3>
      <a href="#http-3-use-by-desktop-browser">
        
      </a>
    </div>
    <p>As we noted last year, <a href="https://caniuse.com/http3">support for HTTP/3 in the stable release channels of major browsers</a> came in November 2020 for Google Chrome and Microsoft Edge, and April 2021 for Mozilla Firefox. We also noted that in Apple Safari, HTTP/3 support needed to be <a href="https://developer.apple.com/forums/thread/660516">enabled</a> in the “Experimental Features” developer menu in production releases. However, in the most recent releases of Safari, it appears that this step is no longer necessary, and that HTTP/3 is now natively supported.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/46nLEn3t41yyWfhZkznaEa/29c5b7bfa59b34f55977cc65ad67c2bf/download--3--2.png" />
            
            </figure><p>Looking at request shares by browser, Chrome started the period responsible for approximately 80% of HTTP/3 request volume, but the continued growth of Safari dropped it to around 74% by May 2023. A year ago, Safari represented less than 1% of HTTP/3 traffic on Cloudflare, but grew to nearly 7% by May 2023, likely as a result of support graduating from experimental to production.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7L26q8bA4sjcNlx7Vh0ohL/667061d148ccbaa0043cd3fd1e38a879/download--4--2.png" />
            
            </figure><p>Removing Chrome from the graph again makes trends across the other browsers more visible. As noted above, Safari experienced significant growth over the last year, while Edge saw a bump from just under 10% to just over 11% in June 2022. It stayed around that level through the new year, and then gradually dropped below 10% over the next several months. Firefox dropped slightly, from around 10% to just under 9%, while reported HTTP/3 traffic from Internet Explorer was near zero.</p><p>As we did in last year’s post, we also wanted to look at how the share of HTTP versions has changed over the last year across each of the leading browsers. The relative stability of HTTP/2 and HTTP/3 seen over the last year is in some contrast to the observations made in last year’s post, which saw some noticeable shifts during the May 2021 - May 2022 timeframe.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3bt30ch54tIJHXIcA4xzNo/ae9bf1593781da888f4c4843ac379465/download--5--1.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/CRgOGynraOznE7gu7AFjM/ec94e0c8be1b4ec2fb4f9f8f0a715cb0/download--6--1.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3AbRtdFXbJ43Xli6w0jVJN/ad597050da4a948d41a9b275c3752d96/download--7-.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/GgWSo7NP45FZffpsqScv1/e269f55f5b59402ad771a065196b3d59/download--8-.png" />
            
            </figure><p>In looking at request share by protocol version across the major desktop browser families, we see that across all of them, HTTP/1.1 share grows in late October. Further analysis indicates that this growth was due to significantly higher HTTP/1.1 request volume across several large customer zones, but it isn’t clear <b>why</b> this influx of traffic using an older version of HTTP occurred. It is clear that HTTP/2 remains the dominant protocol used for content requests by the major browsers, consistently accounting for 50-55% of request volume for Chrome and Edge, and ~60% for Firefox. However, for Safari, HTTP/2’s share dropped from nearly 95% in May 2022 to around 75% a year later, thanks to the growth in HTTP/3 usage.</p><p>HTTP/3 share on Safari grew from under 3% to nearly 18% over the course of the year, while its share on the other browsers was more consistent, with Chrome and Edge hovering around 40% and Firefox around 35%, and both showing pronounced weekday/weekend traffic patterns. (That pattern is arguably the most pronounced for Edge.) Such a pattern becomes more, yet still barely, evident with Safari in late 2022, although it tends to vary by less than a percent.</p>
    <div>
      <h3>HTTP/3 usage by mobile browser</h3>
      <a href="#http-3-usage-by-mobile-browser">
        
      </a>
    </div>
    <p>Mobile devices are responsible for <a href="https://radar.cloudflare.com/traffic?range=28d">over half</a> of request volume to Cloudflare, with Chrome Mobile <a href="https://radar.cloudflare.com/adoption-and-usage?range=28d">generating</a> more than 25% of all requests, and Mobile Safari more than 10%. Given this, we decided to explore HTTP/3 usage across these two key mobile platforms.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6gEIDgm3aTtDYNZj0GD5bS/3728f1ff9a6790b44f66deec6101871c/download--9-.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6a0By0cXENGpNbqV1BQB7G/5ddbdae331642235f4395c0972e8121e/download--10-.png" />
            
            </figure><p>Looking at Chrome Mobile and Chrome Mobile Webview (an embeddable version of Chrome that applications can use to display Web content), we find HTTP/1.1 usage to be minimal, topping out at under 5% of requests. HTTP/2 usage dropped from 60% to just under 55% between May and mid-September, but then bumped back up to near 60%, remaining essentially flat to slightly lower through the rest of the period. In a complementary fashion, HTTP/3 traffic increased from 37% to 45%, before falling just below 40% in mid-September, hovering there through May. The usage patterns ultimately look very similar to those seen with desktop Chrome, albeit without the latter’s clear weekday/weekend traffic pattern.</p><p>Perhaps unsurprisingly, the usage patterns for Mobile Safari and Mobile Safari Webview closely mirror those seen with desktop Safari. HTTP/1.1 share increases in October, and HTTP/3 sees strong growth, from under 3% to nearly 18%.</p>
    <div>
      <h3>Search indexing bots</h3>
      <a href="#search-indexing-bots">
        
      </a>
    </div>
    <p>Exploring usage of the various versions of HTTP by <a href="https://www.cloudflare.com/learning/bots/what-is-a-web-crawler/">search engine crawlers/bots</a>, we find that last year’s trend continues, and that there remains little-to-no usage of HTTP/3. (As mentioned above, this is somewhat expected, as HTTP/3 is optimized for browser use cases.) Graphs for Bing &amp; Baidu here are trimmed to a period ending April 1, 2023 due to anomalous data during April that is being investigated.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2zpXgMRgxrsctpJHrIShZC/ca5830878f4a328f0ee98ea5afdd883b/download--11-.png" />
            
            </figure><p>GoogleBot continues to rely primarily on HTTP/1.1, which generally comprises 55-60% of request volume. The balance is nearly all HTTP/2, although some nominal growth in HTTP/3 usage sees it peaking at just under 2% in March.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/415sWhtv1TxuyQJgW95wq4/a4340af637f9dbc42f25b3d81f61f356/download--12-.png" />
            
            </figure><p>Through January 2023, around 85% of requests from Microsoft’s BingBot were made via HTTP/2, but dropped to closer to 80% in late January. The balance of the requests were made via HTTP/1.1, as HTTP/3 usage was negligible.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2EP2wiznT1eIlRB7rwDQZB/6a2ffcda96dbc4a77f85d4866453aea0/download--13-.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7BxyzvnZnL8rWgIpIcEh9D/63cd123faeb6e9795b3766082b918b1a/download--14-.png" />
            
            </figure><p>Looking at indexing bots from search engines based outside of the United States, Russia’s YandexBot appears to use HTTP/1.1 almost exclusively, with HTTP/2 usage generally around 1%, although there was a period of increased usage between late August and mid-November. It isn’t clear what ultimately caused this increase. There was no meaningful request volume seen over HTTP/3. The indexing bot used by Chinese search engine Baidu also appears to strongly prefer HTTP/1.1, generally used for over 85% of requests. However, the percentage of requests over HTTP/2 saw a number of spikes, briefly reaching over 60% on days in July, November, and December 2022, as well as January 2023, with several additional spikes in the 30% range. Again, it isn’t clear what caused this spiky behavior. HTTP/3 usage by BaiduBot is effectively non-existent as well.</p>
    <div>
      <h3>Social media bots</h3>
      <a href="#social-media-bots">
        
      </a>
    </div>
    <p>Similar to Bing &amp; Baidu above, the graphs below are also trimmed to a period ending April 1.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6JuMhjbBKR1azrJ0zgZfeM/7c765cdc40f70ddbdec16aa447585e0f/download--15-.png" />
            
            </figure><p>Facebook’s use of HTTP/3 for site crawling and indexing over the last year remained near zero, similar to what we observed over the previous year. HTTP/1.1 started the period accounting for under 60% of requests, and except for a brief peak above it in late May, usage of HTTP/1.1 steadily declined over the course of the year, dropping to around 30% by April 2023. As such, use of HTTP/2 increased from just over 40% in May 2022 to over 70% in April 2023. Meta engineers confirmed that this shift away from HTTP/1.1 usage is an expected gradual change in their infrastructure's use of HTTP, and that they are slowly working towards removing HTTP/1.1 from their infrastructure entirely.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6Gq43pPPIHZuV6L8gqwHCv/1bb85f1d4eb42551a64e41e943678e7f/download--16-.png" />
            
            </figure><p>In last year’s blog post, we noted that “TwitterBot clearly has a strong and consistent preference for HTTP/2, accounting for 75-80% of its requests, with the balance over HTTP/1.1.” This preference generally remained the case through early October, at which point HTTP/2 usage began a gradual decline to just above 60% by April 2023. It isn’t clear what drove the week-long HTTP/2 drop and HTTP/1.1 spike in late May 2022. And as we noted last year, TwitterBot’s use of HTTP/3 remains non-existent.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4fb6YfpvO1LgDfHmQ9ExXh/5c999b0cf8ced8ca0c7a64b9788c3fb5/download--17-.png" />
            
            </figure><p>In contrast to Facebook’s and Twitter’s site crawling bots, HTTP/3 actually accounts for a noticeable, and growing, volume of requests made by LinkedIn’s bot, increasing from just under 1% in May 2022 to just over 10% in April 2023. We noted last year that LinkedIn’s use of HTTP/2 began to take off in March 2022, growing to approximately 5% of requests. Usage of this version gradually increased over this year’s surveyed period to 15%, although the growth was particularly erratic and spiky, as opposed to a smooth, consistent increase. HTTP/1.1 remained the dominant protocol used by LinkedIn’s bots, although its share dropped from around 95% in May 2022 to 75% in April 2023.</p>
    <div>
      <h3>Conclusion</h3>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>On the whole, we are excited to see that usage of HTTP/3 has generally increased for browser-based consumption of traffic, and recognize that there is opportunity for significant further growth if and when it starts to be used more actively for API interactions through production support in key tools like curl. And though disappointed to see that search engine and social media bot usage of HTTP/3 remains minimal to non-existent, we also recognize that the real-time benefits of using the newest version of the web’s foundational protocol may not be completely applicable for asynchronous automated content retrieval.</p><p>You can follow these and other trends in the “Adoption and Usage” section of Cloudflare Radar at <a href="https://radar.cloudflare.com/adoption-and-usage">https://radar.cloudflare.com/adoption-and-usage</a>, as well as by following <a href="https://twitter.com/cloudflareradar">@CloudflareRadar</a> on Twitter or <a href="https://cloudflare.social/@radar">https://cloudflare.social/@radar</a> on Mastodon.</p> ]]></content:encoded>
            <category><![CDATA[QUIC]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[IETF]]></category>
            <guid isPermaLink="false">7Dpg4lAaYLKzXNozcyuxdv</guid>
            <dc:creator>David Belson</dc:creator>
            <dc:creator>Lucas Pardue</dc:creator>
        </item>
        <item>
            <title><![CDATA[Measuring network quality to better understand the end-user experience]]></title>
            <link>https://blog.cloudflare.com/aim-database-for-internet-quality/</link>
            <pubDate>Tue, 18 Apr 2023 13:00:00 GMT</pubDate>
            <description><![CDATA[ Starting today, you don’t have to be a network engineer to figure out what your Internet is good for. Let’s tell you how we’re doing it. ]]></description>
            <content:encoded><![CDATA[ <p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3IimU9cm3fV1XvBvAJwmdE/06aabe48db2f742bfdd6e88a34cdfba6/111.png" />
            
            </figure><p>You’re visiting your family for the holidays and you connect to the WiFi, and then notice Netflix isn’t loading as fast as it normally does. You go to speed.cloudflare.com, fast.com, speedtest.net, or type “speed test” into Google Chrome to figure out if there is a problem with your Internet connection, and get something that looks like this:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6FH3ra6GdbzBMT650WqWeG/9f9a58e5031c5a7363c07e70b7fdfc5d/112.png" />
            
            </figure><p>If you want to see what that looks like for you, try it yourself <a href="https://speed.cloudflare.com/">here</a>. But what do those numbers mean? How do those numbers relate to whether or not your Netflix isn’t loading or any of the other common use cases: playing games or audio/video chat with your friends and loved ones? Even network engineers find that speed tests are difficult to relate to the user experience of… using the Internet.</p><p>Amazingly, speed tests have barely changed in nearly two decades, even though the way we use the Internet has changed a lot. With so many more people on the Internet, the gaps between speed tests and the user’s experience of network quality are growing. The problem is so important that the Internet’s standards organization is <a href="https://datatracker.ietf.org/doc/rfc9318/">paying attention</a>, too.</p><p>From a high-level, there are three grand network test challenges:</p><ol><li><p>Finding ways to efficiently and accurately measure network quality, and convey to end-users if and how the quality affects their experience.</p></li><li><p>When a problem is found, figuring out where the problem exists, be it the wireless connection, or one many cables and machines that make up the Internet.</p></li><li><p>Understanding a single user’s test results in context of their neighbors’, or archiving the results to, for example, compare neighborhoods or know if the network is getting better or worse.</p></li></ol><p>Cloudflare is excited to announce a new Aggregated Internet Measurement (AIM) initiative to help address all three challenges. AIM is a new and open format for displaying Internet quality in a way that makes sense to end users of the Internet, around use cases that demand specific types of Internet performance while still retaining all of the network data engineers need to troubleshoot problems on the Internet. We’re excited to partner with <a href="https://www.measurementlab.net/">Measurement Lab</a> on this project and store all of this data in a <a href="https://colab.research.google.com/drive/1xgc-7L1Okr04MSjsYJfiFeUN0Gu05bpQ?usp=sharing">publicly available repository</a> that you can access to analyze the data behind the scores you see on your speed test page, whose source code is <a href="https://github.com/cloudflare/speedtest">now open-sourced</a> along with the AIM score calculations.</p>
    <div>
      <h2>What is a speed test?</h2>
      <a href="#what-is-a-speed-test">
        
      </a>
    </div>
    <p>A speed test is a point-in-time measurement of your Internet connection. When you connect to any speed test, it typically tries to fetch a large file (important for <a href="https://www.cloudflare.com/developer-platform/solutions/live-streaming/">video streaming</a>), performs a packet loss test (important for gaming), measures jitter (important for video/VoIP calls), and latency (important for all Internet use cases). The goal of this test is to measure your Internet connection’s ability to perform basic tasks.</p><p>There are some challenges with this approach that start with a simple observation: At the “<a href="https://www.cloudflare.com/learning/network-layer/what-is-the-network-layer/">network-layer</a>” of the Internet that moves data and packets around, there are three and only three measures that can be directly observed. They are,</p><ul><li><p>available <i>bandwidth</i>, sometimes known as “throughput”;</p></li><li><p>packet <i>loss,</i> which occurs at extremely low levels throughout the Internet at steady state_;_ and</p></li><li><p><i>latency</i>, often referred to as the <a href="https://www.cloudflare.com/learning/cdn/glossary/round-trip-time-rtt/">round-trip time (RTT)</a>.</p></li></ul><p>These three attributes are tightly interwoven. In particular, the portion of available bandwidth that a user actually achieves (throughput) is directly affected by loss and latency. Your computer uses loss and latency to decide when to send a packet, or not. Some loss and latency is expected, even needed! Too much of either, and bandwidth starts to fall.</p><p>These are simple numbers, but their relationship is far from simple. Think about all the ways to add two numbers to equal <i>as much as</i> one-hundred, x + y ≤ 100. If x and y are just right, then they add to one hundred. However, there are many combinations of x and y that do. Worse is that if either x or y or both are a little wrong, then they add to less than one-hundred. In this example, x and y are loss and latency, and 100 is the available bandwidth.</p><p>There are other forces at work, too, and these numbers do not tell the whole story. But they are the only numbers that are directly observable. Their meaning and the reasons they matter for diagnosis are important, so let’s discuss each one of those in order and how Aggregated Internet Measurement tries to solve each of these.</p>
    <div>
      <h2>What do the numbers in a speed test mean?</h2>
      <a href="#what-do-the-numbers-in-a-speed-test-mean">
        
      </a>
    </div>
    <p>Most speed tests will run and produce the numbers you saw above: bandwidth, latency, jitter, and packet loss. Let’s break down each of these numbers one by one to explain what they mean:</p>
    <div>
      <h3>Bandwidth</h3>
      <a href="#bandwidth">
        
      </a>
    </div>
    <p>Bandwidth is the maximum throughput/capacity over a communication link. The common analogy used to define bandwidth is if your Internet connection is a highway, bandwidth is how many lanes the highway has and cars that fit on it. Bandwidth has often been called “speed” in the past because Internet Service Providers (ISPs) measure speed as the amount of time it takes to download a large file, and having more bandwidth on your connection can make that happen faster.</p>
    <div>
      <h3>Packet loss</h3>
      <a href="#packet-loss">
        
      </a>
    </div>
    <p>Packet loss is exactly what it sounds like: some packets are sent from a source to a destination, but the packets are not received by the destination. This can be very impactful for many applications, because if information is lost in transit en route to the receiver, it an e ifiult fr te recvr t udrsnd wt s bng snt (it can be difficult for the receiver to understand what is being sent).</p>
    <div>
      <h3>Latency</h3>
      <a href="#latency">
        
      </a>
    </div>
    <p><a href="https://www.cloudflare.com/learning/performance/glossary/what-is-latency/">Latency</a> is the time it takes for a packet/message to travel from point A to point B. At its core, the Internet is composed of computers sending signals in the form of electrical signals or beams of light over cables to other computers. Latency has generally been defined as the time it takes for that electrical signal to go from one computer to another over a cable or fiber. Therefore, it follows that one way to reduce latency is to shrink the distance the signals need to travel to reach their destination.</p><p>There is a distinction in latency between idle latency and latency under load. This is because there are queues at routers and switches that store data packets when they arrive faster than they can be transmitted. Queuing is normal, by design, and keeps data flowing correctly. However, if the queues are too big, or when other applications behave very differently from yours, the connection can feel slower than it actually is. This event is called <a href="https://www.bufferbloat.net/projects/">bufferbloat</a>.</p><p>In our AIM test we look at idle latency to show you what your latency <i>could</i> be, but we also collect loaded latency, which is a better reflection of what your latency is during your day-to-day Internet experience.</p>
    <div>
      <h3>Jitter</h3>
      <a href="#jitter">
        
      </a>
    </div>
    <p>Jitter is a special way of measuring latency. It is the variance in latency on your Internet connection. If jitter is high, it may take longer for some packets to arrive, which can impact Internet scenarios that require content to be delivered in real time, such as voice communication.</p><p>A good way to think about jitter is to think about a commute to work along some route or path. Latency, alone, asks “how far am I from the destination measured in time?” For example, the average journey on a train is 40 minutes. Instead of journey time, jitter asks, “how consistent is my travel time?” Thinking about the commute, a jitter of zero means the train always takes 40 minutes. However, if the jitter is 15 then, well, the commute becomes a lot more challenging because it could take anywhere from 25 to 55 minutes.</p><p>But even if we understand these numbers, for all that they might tell us <i>what</i> is happening, they are unable to tell us <i>where</i> something is happening.</p>
    <div>
      <h2>Is WiFi or my Internet connection the problem?</h2>
      <a href="#is-wifi-or-my-internet-connection-the-problem">
        
      </a>
    </div>
    <p>When you run a speed test, you’re not just connecting to your ISP, you’re also connecting to your local network which connects to your ISP. And your local network may have problems of its own. Take a speed test that has high packet loss and jitter: that generally means something on the network could be dropping packets. Normally, you would call your ISP, who will often say something like “get closer to your WiFi access point or get an extender”.</p><p>This is important — WiFi uses radio waves to transmit information, and materials like brick, plaster, and concrete can interfere with the signal and make it weaker the farther away you get from your access point. Mesh WiFi appliances like Nest WiFi and Eero periodically take speed tests from their main access point specifically to help detect issues like this. So having <a href="https://developers.cloudflare.com/fundamentals/speed/aim/">potential quick solutions</a> for problems like high packet loss and jitter and giving that to users up front can help users better ascertain if the problem is related to their wireless connection setup.</p><p>While this is true for most issues that we see on the Internet, it often helps if network operators are able to look at this data in aggregate in addition to simply telling users to get closer to their access points. If your speed test went to a place where your network operator could see it and others in your area, network engineers may be able to proactively detect issues before users report them. This not only helps users, it helps network providers as well, because fielding calls and sending out technicians for issues due to user configuration are expensive in addition to being time consuming.</p><p>This is one of the goals of AIM: to help solve the problem before anyone picks up a phone. End users can get a series of tips that will help them understand what their Internet connection can and can’t do and how they can improve it in an easy-to-read format, and network operators can get all the data they need to detect last mile issues before anyone picks up a phone, saving time and money. Let’s talk about how that can work with a real example.</p>
    <div>
      <h2>An example from a real life</h2>
      <a href="#an-example-from-a-real-life">
        
      </a>
    </div>
    <p>When you get a speed test result, the numbers you get can be confusing. This is because you may not understand how those numbers combine to impact your Internet experience. Let’s talk about a real life example and how that impacts you.</p><p>Say you work in a building with four offices and a main area that looks like this:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4mI2OjDE4asb8FmKeHtJCP/a0e9c36be7927a996729a833f3f9457a/113.png" />
            
            </figure><p>You have to make video calls to her clients all day and you sit in the office farthest away from the wireless access point. Your calls are dropping constantly and you’re having a really bad experience. When you runs a speed test from her office, she sees this result:</p>
<table>
<thead>
  <tr>
    <th><span>Metric</span></th>
    <th><span>Far away from access point</span></th>
    <th><span>Close to access point</span></th>
  </tr>
</thead>
<tbody>
  <tr>
    <td><span>Download Bandwidth</span></td>
    <td><span>21.8 Mbps</span></td>
    <td><span>25.7 Mbps</span></td>
  </tr>
  <tr>
    <td><span>Upload Bandwidth</span></td>
    <td><span>5.66 Mbps</span></td>
    <td><span>5.26 Mbps</span></td>
  </tr>
  <tr>
    <td><span>Unloaded Latency</span></td>
    <td><span>19.6 ms</span></td>
    <td><span>19.5 ms</span></td>
  </tr>
  <tr>
    <td><span>Jitter</span></td>
    <td><span>61.4 ms</span></td>
    <td><span>37.9 ms</span></td>
  </tr>
  <tr>
    <td><span>Packet Loss</span></td>
    <td><span>7.7%</span></td>
    <td><span>0%</span></td>
  </tr>
</tbody>
</table><p>How can you make sense of these? A network engineer would take a look at the high jitter and the packet loss and think “well this user probably needs to move closer to the router to get a better signal”. But you may take a look at these results and have no idea, and have to ask a network engineer for help, which could lead to a call to your ISP, wasting the time and money of everyone. But you shouldn’t have to consult a network engineer to figure out if you need to move your WiFi access point, or if your ISP isn’t giving her a good experience.</p><p>Aggregated Internet Measurement assigns qualitative assessments to the numbers on your speed test to help you make sense of these numbers. We’ve created scenario-specific scores, which is a singular qualitative value that is calculated on a scenario level: we calculate different quality scores based on what you’re trying to do. To start, we’ve created three AIM scores: Streaming, Gaming, and WebChat/RTC. Those scores weigh each metric differently based on what Internet conditions are required for the application to run successfully.</p><p>The AIM scoring rubric assigns point values to your connection based on the tests. We’re releasing AIM with a “weighted score,” in which the point values are calculated based on what metrics matter the most in those scenarios. These point scores aren’t designed to be static, but to evolve based on what application developers, network operators, and the Internet community discover about how different performance characteristics affect application experience for each scenario – and it’s one more reason to post the data to M-Lab, so that the community can help design and converge on good scoring mechanisms.</p><p>Here is the full rubric and each of the point values associated with the metrics today:</p>
<table>
<thead>
  <tr>
    <th><span>Metric</span></th>
    <th><span>0 points</span></th>
    <th><span>5 points</span></th>
    <th><span>10 points</span></th>
    <th><span>20 points</span></th>
    <th><span>30 points</span></th>
    <th><span>50 points</span></th>
  </tr>
</thead>
<tbody>
  <tr>
    <td><span>Loss Rate</span></td>
    <td><span>&gt; 5%</span></td>
    <td><span>&lt; 5%</span></td>
    <td><span>&lt; 1%</span></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td><span>Jitter</span></td>
    <td><span>&gt; 20 ms</span></td>
    <td><span>&lt; 20ms</span></td>
    <td><span>&lt; 10ms</span></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td><span>Unloaded latency</span></td>
    <td><span>&gt; 100ms</span></td>
    <td><span>&lt; 50ms</span></td>
    <td><span>&lt; 20ms</span></td>
    <td><span>&lt; 10ms</span></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td><span>Download Throughput</span></td>
    <td><span>&lt; 1Mbps</span></td>
    <td><span>&lt; 10Mbps</span></td>
    <td><span>&lt; 50Mbps</span></td>
    <td><span>&lt; 100Mbps</span></td>
    <td><span>&lt; 1000Mbps</span></td>
    <td></td>
  </tr>
  <tr>
    <td><span>Upload Throughput</span></td>
    <td><span>&lt; 1Mbps</span></td>
    <td><span>&lt; 10Mbps</span></td>
    <td><span>&lt; 50Mbps</span></td>
    <td><span>&lt; 100Mbps</span></td>
    <td><span>&lt; 1000Mbps</span></td>
    <td></td>
  </tr>
  <tr>
    <td><span>Difference between loaded and unloaded latency</span></td>
    <td><span>&gt; 50ms</span></td>
    <td><span>&lt; 50ms</span></td>
    <td><span>&lt; 20ms</span></td>
    <td><span>&lt; 10ms</span></td>
    <td></td>
    <td></td>
  </tr>
</tbody>
</table><p>And here’s a quick overview of what values matter and how we calculate scores for each scenario:</p><ul><li><p>Streaming: download bandwidth + unloaded latency + packet loss + (loaded latency - unloaded latency difference)</p></li><li><p>Gaming: packet loss + unloaded latency + (loaded latency - unloaded latency difference)</p></li><li><p>RTC/video: packet loss + jitter + unloaded latency + (loaded latency - unloaded latency difference)</p></li></ul><p>To calculate each score, we take the point values from your speed test and calculate that out of the total possible points for that scenario. So based on the result, we can give your Internet connection a judgment for each scenario: Bad, Poor, Average, Good, and Great. For example, for Video calls, packet loss, jitter, unloaded latency, and the difference between loaded and unloaded latency matter when determining whether or not your Internet quality is good for video calls. We add together the point values derived from your speed test values and we get a score that shows how far away from the perfect video call experience your Internet quality is. Based on your speed test, here are the AIM scores from your office far away from the access point:</p>
<table>
<thead>
  <tr>
    <th><span>Metric</span></th>
    <th><span>Result</span></th>
  </tr>
</thead>
<tbody>
  <tr>
    <td><span>Streaming Score</span></td>
    <td><span>25/70 pts (Average)</span></td>
  </tr>
  <tr>
    <td><span>Gaming Score</span></td>
    <td><span>15/40 pts (Poor)</span></td>
  </tr>
  <tr>
    <td><span>RTC Score</span></td>
    <td><span>15/50 pts (Average)</span></td>
  </tr>
</tbody>
</table><p>So instead of saying “Your bandwidth is X and your jitter is Y”, we can say “Your Internet is okay for Netflix, but poor for gaming, and only average for Zoom”. In this case, moving the WiFi access point to a more centralized location turned out to be the solution, and turned your AIM scores into this:</p>
<table>
<thead>
  <tr>
    <th><span>Metric</span></th>
    <th><span>Result</span></th>
  </tr>
</thead>
<tbody>
  <tr>
    <td><span>Streaming Score</span></td>
    <td><span>45/70 pts (Good)</span></td>
  </tr>
  <tr>
    <td><span>Gaming Score</span></td>
    <td><span>35/40 pts (Great)</span></td>
  </tr>
  <tr>
    <td><span>RTC Score</span></td>
    <td><span>35/50 pts (Great)</span></td>
  </tr>
</tbody>
</table><p>You can even see these results on the Cloudflare speed test today as a Network Quality Score:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/CrZxqJ79VLN4MM6O0gMOX/440836054b316ba12616cb623b6ecd0f/114.png" />
            
            </figure><p>In this particular case, there was no call required to the ISP, and no network engineers were consulted. Simply moving the access point closer to the middle of the office improved the experience for everyone, and no one needed to pick up the phone, providing a more seamless experience for everyone.</p><p>AIM takes the metrics that network engineers care about and it translates them into a more human-readable metric that’s based on the applications you are trying to use. Aggregated data is anonymous (in compliance with our <a href="https://www.cloudflare.com/privacypolicy/">privacy policy</a>), so that your ISP can actually look up speed tests in your metro area and that use your ISP and get the underlying data to help translate user complaints into something that is actionable by network engineers. Additionally, policy makers and researchers can examine the aggregate data to better understand what users in their communities are experiencing to help lobby for better Internet quality.</p>
    <div>
      <h2>Working conditions</h2>
      <a href="#working-conditions">
        
      </a>
    </div>
    <p>Here’s an interesting question: When you run a speed test, where are you connecting to and what is the Internet like at the other end of the connection? One of the challenges that speed tests often face is that the servers you run your test against are not the same servers that run or protect your websites. Because of this, the network paths your speed test may take to the host on the other side may be vastly different, and may even be optimized to serve as many speed tests as possible. This means that your speed test is not actually testing the path that your traffic normally takes when it’s reaching the applications you normally use. The tests that you ran are measuring a network path, but it’s not the network path you use on a regular basis.</p><p>Speed tests should be run under real-world network conditions that reflect how people use the Internet, with multiple applications, browser tabs, and devices all competing for connectivity. This concept of measuring your Internet connection using application-facing tools and doing so while your network is being used as much as possible is called measuring under working conditions. Today, when speed tests run, they make entirely new connections to a website that is reserved for testing network performance. Unfortunately, day-to-day Internet usage isn’t done on new connections to dedicated speed test websites. This is actually by design for many Internet applications, which rely on reusing the same connection to a website to provide a better performing experience to the end-user by eliminating costly latency incurred by establishing encryption, exchanging of certificates, and more.</p><p>AIM is helping to solve this problem in several ways. The first is that we’ve implemented all of our tests the same way our applications would, and measure them under working conditions. We measure loaded latency to show you how your Internet connection behaves when you’re actually using it. You can see it on the speed test today:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7HSlY2m75rAmNht9BuCjZc/9ff7bf8ea97bd8f49fa0ae46d8c487eb/Screenshot-2023-02-10-at-11.43.27.png" />
            
            </figure><p>The second is that we are collecting speed test results against endpoints that you use today. By measuring speed tests against Cloudflare and other sites, we are showing end user Internet quality against networks that are frequently used in your daily life, which gives a better idea of what actual working conditions are.</p>
    <div>
      <h2>AIM database</h2>
      <a href="#aim-database">
        
      </a>
    </div>
    <p>We’re excited to announce that AIM data is <a href="https://colab.research.google.com/drive/1xgc-7L1Okr04MSjsYJfiFeUN0Gu05bpQ?usp=sharing">publicly available today</a> through a partnership with Measurement Lab (M-Lab), and end-users and network engineers alike can parse through network quality data across a variety of networks. M-Lab and Cloudflare will both be calculating AIM scores derived from their speed tests and putting them into a shared database so end-users and network operators alike can see Internet quality from as many points as possible across a multitude of different speed tests.</p><p>For just a sample of what we’re seeing, let’s take a look at a visual we’ve made using this data plotting scores from only Cloudflare data per scenario in Tokyo, Japan for the first week of October:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4AVAz6PoQwTJszzgx0Bi3Z/32e6ad5e435711d326e0d5810726eb13/116.png" />
            
            </figure><p>Based on this, you can see that out of the 5,814 speed tests run, 50.7% of those users had a good streaming quality, but 48.2% were only average. Gaming appears to be relatively hard in Tokyo as 39% of users had a poor gaming experience, but most users had a pretty average-to-decent RTC experience. Let’s take a look at how that compares to some of the other cities we see:</p>
<table>
<thead>
  <tr>
    <th><span>City</span></th>
    <th><span>Average Streaming Score</span></th>
    <th><span>Average Gaming Score</span></th>
    <th><span>Average RTC Score</span></th>
  </tr>
</thead>
<tbody>
  <tr>
    <td><span>Tokyo</span></td>
    <td><span>31</span></td>
    <td><span>13</span></td>
    <td><span>16</span></td>
  </tr>
  <tr>
    <td><span>New York</span></td>
    <td><span>33</span></td>
    <td><span>13</span></td>
    <td><span>17</span></td>
  </tr>
  <tr>
    <td><span>Mumbai</span></td>
    <td><span>25</span></td>
    <td><span>13</span></td>
    <td><span>16</span></td>
  </tr>
  <tr>
    <td><span>Dublin</span></td>
    <td><span>32</span></td>
    <td><span>14</span></td>
    <td><span>18</span></td>
  </tr>
</tbody>
</table><p>Based on our data, we can see that most users do okay for video streaming except for Mumbai, which is a bit behind. Users generally have a variable gaming experience due to high latency being the primary driver behind the gaming score, but their RTC apps do slightly better, being generally average in all the locales.</p>
    <div>
      <h2>Collaboration with M-Lab</h2>
      <a href="#collaboration-with-m-lab">
        
      </a>
    </div>
    <p>M-Lab is an open, Internet measurement repository whose mission is to measure the Internet, save the data, and make it universally accessible and useful. In addition to providing free and open access to the AIM data for network operators, M-Lab will also be giving policy makers, academic researchers, journalists, digital inclusion advocates, and anyone who is interested access to the data they need to make important decisions that can help improve the Internet.</p><p>In addition to already being an established name in open sharing of Internet quality data to policy makers and academics, M-Lab already provides a “speed” test called Network Diagnostic Test (NDT) that is the same speed test you run when you type “speed test” into Google. By partnering with M-Lab, we are getting Aggregated Internet Measurement metrics from many more users. We want to partner with other speed tests as well to get the complete picture of how Internet quality is mapped across the world for as many users as possible. If you measure Internet performance today, we want you to join us to help show users what their Internet is really good for.</p>
    <div>
      <h2>Speed test, now open sourced</h2>
      <a href="#speed-test-now-open-sourced">
        
      </a>
    </div>
    <p>In addition to partnering with M-Lab, we’ve also open-sourced our speed test client. Open-sourcing the speed test is an important step towards giving applications access to speed measurements through Cloudflare, and an easy way to start calculating AIM scores for your application. Our speed test is now embeddable as a javascript application so that you can perform network quality tests without needing to navigate to the browser. The application not only provides you all of the measurements we use for our speed test today, but also uploads the results in a private fashion to Cloudflare. The repository also shows how we are calculating the AIM scores, so that you can see the inner workings of how network quality is being defined to end-users and how that changes in real-time. To get started developing with our open-source speed test, check out the <a href="https://github.com/cloudflare/speedtest">open-source link</a>.</p>
    <div>
      <h2>A bright future for Internet quality</h2>
      <a href="#a-bright-future-for-internet-quality">
        
      </a>
    </div>
    <p>We’re excited to put this data together to show Internet quality across a variety of tests and networks. We’re going to be analyzing this data and improving our scoring system, and we’ve open-sourced it so that you can see how we are using speed test measurements to score Internet quality across a variety of different applications and even implement AIM yourself. We’ve also put our AIM scores in the speed test alongside all of the tests you see today so that you can finally get a better understanding of what your Internet is good for.</p><p>If you’re running a speed test today and you’re interested in partnering with us to help gather data on how users experience Internet quality, <a>reach out</a> to us and let’s work together to help make the Internet better. And if you’re running an application that wants to measure Internet quality, check out our <a href="https://github.com/cloudflare/speedtest">open source repo</a> so that you can start developing today.</p><p>Figuring out what your Internet is good for shouldn’t require you to become a networking expert; that’s what we’re here for. With AIM and our collaborators at MLab, we want to be able to tell you what your Internet can do and use that information to help <a href="https://blog.cloudflare.com/50-years-of-the-internet-work-in-progress-to-a-better-internet/">make the Internet better</a> for everyone.</p> ]]></content:encoded>
            <category><![CDATA[Network]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Internet Quality]]></category>
            <guid isPermaLink="false">6uJzPTICOVrX9qkT9solfp</guid>
            <dc:creator>David Tuber</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare mitigates record-breaking 71 million request-per-second DDoS attack]]></title>
            <link>https://blog.cloudflare.com/cloudflare-mitigates-record-breaking-71-million-request-per-second-ddos-attack/</link>
            <pubDate>Mon, 13 Feb 2023 18:37:51 GMT</pubDate>
            <description><![CDATA[ This was a weekend of record-breaking DDoS attacks. Over the weekend, Cloudflare detected and mitigated dozens of hyper-volumetric DDoS attacks. The majority of attacks peaked in the ballpark of 50-70 million requests per second (rps) with the largest exceeding 71 million rps ]]></description>
            <content:encoded><![CDATA[ <p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4zzsCqug2fzQ1LZ9cDhPPc/f41f616c5972ce12c9dedbb8844a2147/DDoS-protection-1.png" />
            
            </figure><p>This was a weekend of record-breaking <a href="https://www.cloudflare.com/learning/ddos/what-is-a-ddos-attack/">DDoS attacks</a>. Over the weekend, Cloudflare detected and mitigated dozens of <i>hyper-volumetric</i> DDoS attacks. The majority of attacks peaked in the ballpark of 50-70 million requests per second (rps) with the largest exceeding 71 million rps. This is the largest reported HTTP DDoS attack on record, more than 54% higher than the previous reported record of 46M rps in June 2022.</p><p>The attacks were HTTP/2-based and targeted websites protected by Cloudflare. They originated from over 30,000 IP addresses. Some of the attacked websites included a popular gaming provider, cryptocurrency companies, hosting providers, and cloud computing platforms. The attacks originated from numerous cloud providers, and we have been working with them to crack down on the botnet.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/TDtAM4ae2w8i3WkfQqd08/737282a05169368edb3dfaaa54b7afaa/1711-1.png" />
            
            </figure><p>Record breaking attack: DDoS attack exceeding 71 million requests per second</p><p>Over the past year, we’ve seen more attacks originate from cloud computing providers. For this reason, we will be providing service providers that own their own autonomous system a <a href="/botnet-threat-feed-for-isp/">free Botnet threat feed</a>. The feed will provide service providers threat intelligence about their own IP space; attacks originating from within their autonomous system. Service providers that operate their own IP space can now <a href="https://www.cloudflare.com/lp/botnet-threat-feed/">sign up</a> to the early access waiting list.</p>
    <div>
      <h3>Is this related to the Super Bowl or Killnet?</h3>
      <a href="#is-this-related-to-the-super-bowl-or-killnet">
        
      </a>
    </div>
    <p>No. This campaign of attacks arrives less than two weeks after the <a href="/uptick-in-healthcare-organizations-experiencing-targeted-ddos-attacks/">Killnet DDoS campaign that targeted healthcare websites</a>. Based on the methods and targets, we do not believe that these recent attacks are related to the healthcare campaign. Furthermore, yesterday was the US Super Bowl, and we also do not believe that this attack campaign is related to the game event.</p>
    <div>
      <h3>What are DDoS attacks?</h3>
      <a href="#what-are-ddos-attacks">
        
      </a>
    </div>
    <p>Distributed Denial of Service attacks are cyber attacks that aim to take down Internet properties and make them unavailable for users. These types of cyberattacks can be very efficient against unprotected websites and they can be very inexpensive for the attackers to execute.</p><p>An HTTP DDoS attack usually involves a <a href="https://www.cloudflare.com/learning/ddos/http-flood-ddos-attack/">flood of HTTP requests</a> towards the target website. The attacker’s objective is to bombard the website with more requests than it can handle. Given a sufficiently high amount of requests, the website’s server will not be able to process all of the attack requests along with the <i>legitimate</i> user requests. Users will experience this as website-load delays, timeouts, and eventually not being able to connect to their desired websites at all.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/41VYHEH1KGaJHxqfyuCUX3/62edd1a178f035d50b0ec325fde9d074/1711-2.png" />
            
            </figure><p>Illustration of a DDoS attack</p><p>To make attacks larger and more complicated, attackers usually leverage a network of bots — a <a href="https://www.cloudflare.com/learning/ddos/what-is-a-ddos-botnet/"><i>botnet</i></a>. The attacker will orchestrate the botnet to bombard the victim’s websites with HTTP requests. A sufficiently large and powerful botnet can generate very large attacks as we’ve seen in this case.</p><p>However, building and operating botnets requires a lot of investment and expertise. What is the average Joe to do? Well, an average Joe that wants to launch a DDoS attack against a website doesn’t need to start from scratch. They can hire one of numerous DDoS-as-a-Service platforms for as little as $30 per month. The more you pay, the larger and longer of an attack you’re going to get.</p>
    <div>
      <h3>Why DDoS attacks?</h3>
      <a href="#why-ddos-attacks">
        
      </a>
    </div>
    <p>Over the years, it has become easier, cheaper, and more accessible for attackers and attackers-for-hire to launch DDoS attacks. But as easy as it has become for the attackers, we want to make sure that it is even easier - and free - for defenders of organizations of all sizes to protect themselves against DDoS attacks of all types.</p><p>Unlike <a href="https://www.cloudflare.com/learning/security/ransomware/what-is-ransomware/">Ransomware</a> attacks, <a href="https://www.cloudflare.com/learning/ddos/ransom-ddos-attack/">Ransom DDoS attacks</a> don’t require an actual system intrusion or a foothold within the targeted network. Usually Ransomware attacks start once an employee naively clicks an email link that installs and propagates the malware. There’s no need for that with DDoS attacks. They are more like a hit-and-run attack. All a DDoS attacker needs to know is the website’s address and/or IP address.</p>
    <div>
      <h3>Is there an increase in DDoS attacks?</h3>
      <a href="#is-there-an-increase-in-ddos-attacks">
        
      </a>
    </div>
    <p>Yes. The size, sophistication, and frequency of attacks has been increasing over the past months. In our latest <a href="/ddos-threat-report-2022-q4/">DDoS threat report</a>, we saw that the amount of HTTP DDoS attacks increased by 79% year-over-year. Furthermore, the amount of volumetric attacks exceeding 100 Gbps grew by 67% quarter-over-quarter (QoQ), and the number of attacks lasting more than three hours increased by 87% QoQ.</p><p>But it doesn’t end there. The audacity of attackers has been increasing as well. In our latest DDoS threat report, we saw that Ransom DDoS attacks steadily increased throughout the year. They peaked in November 2022 where one out of every four surveyed customers reported being subject to Ransom DDoS attacks or threats.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1dtJk2dHnMO7XbQ7RQM79W/02faf2f2a4494adf85062060581c1644/1711-3.png" />
            
            </figure><p>Distribution of Ransom DDoS attacks by month</p>
    <div>
      <h3>Should I be worried about DDoS attacks?</h3>
      <a href="#should-i-be-worried-about-ddos-attacks">
        
      </a>
    </div>
    <p>Yes. If your website, server, or networks are not protected against volumetric DDoS attacks using a cloud service that provides automatic detection and mitigation, we really recommend that you consider it.</p><p>Cloudflare customers shouldn’t be worried, but should be aware and prepared. Below is a list of recommended steps to ensure your security posture is optimized.</p>
    <div>
      <h3>What steps should I take to defend against DDoS attacks?</h3>
      <a href="#what-steps-should-i-take-to-defend-against-ddos-attacks">
        
      </a>
    </div>
    <p>Cloudflare’s systems have been automatically detecting and <a href="https://www.cloudflare.com/learning/ddos/ddos-mitigation/">mitigating</a> these DDoS attacks.</p><p>Cloudflare offers many features and capabilities that you may already have access to but may not be using. So as extra precaution, we recommend taking advantage of these capabilities to improve and optimize your security posture:</p><ol><li><p>Ensure all <a href="https://developers.cloudflare.com/ddos-protection/managed-rulesets/">DDoS Managed Rules</a> are set to default settings (High sensitivity level and mitigation actions) for optimal DDoS activation.</p></li><li><p><a href="https://www.cloudflare.com/plans/enterprise/">Cloudflare Enterprise</a> customers that are subscribed to the Advanced DDoS Protection service should consider enabling <a href="https://developers.cloudflare.com/ddos-protection/managed-rulesets/adaptive-protection/">Adaptive DDoS Protection</a>, which mitigates attacks more intelligently based on your unique traffic patterns.</p></li><li><p>Deploy <a href="https://developers.cloudflare.com/firewall/cf-firewall-rules/">firewall rules</a> and <a href="https://developers.cloudflare.com/waf/rate-limiting-rules/">rate limiting rules</a> to enforce a combined positive and negative security model. Reduce the traffic allowed to your website based on your known usage.</p></li><li><p>Ensure your origin is not exposed to the public Internet (i.e., <a href="https://developers.cloudflare.com/fundamentals/get-started/setup/allow-cloudflare-ip-addresses/">only enable access to Cloudflare IP addresses</a>). As an extra security precaution, we recommend contacting your hosting provider and requesting new origin server IPs if they have been targeted directly in the past.</p></li><li><p>Customers with access to <a href="https://developers.cloudflare.com/fundamentals/global-configurations/lists/ip-lists/#managed-ip-lists">Managed IP Lists</a> should consider leveraging those lists in firewall rules. Customers with <a href="https://developers.cloudflare.com/bots/get-started/bm-subscription/">Bot Management</a> should consider leveraging the bot scores within the firewall rules.</p></li><li><p>Enable <a href="https://developers.cloudflare.com/cache/">caching</a> as much as possible to reduce the strain on your origin servers, and when using <a href="https://workers.cloudflare.com/">Workers</a>, avoid overwhelming your origin server with more subrequests than necessary.</p></li><li><p>Enable <a href="https://developers.cloudflare.com/ddos-protection/reference/alerts/">DDoS alerting</a> to improve your response time.</p></li></ol>
    <div>
      <h3>Preparing for the next DDoS wave</h3>
      <a href="#preparing-for-the-next-ddos-wave">
        
      </a>
    </div>
    <p>Defending against DDoS attacks is critical for organizations of all sizes. While attacks may be initiated by humans, they are executed by bots — and to play to win, you must fight bots with bots. Detection and mitigation must be automated as much as possible, because relying solely on humans to mitigate in real time puts defenders at a disadvantage. Cloudflare’s automated systems constantly detect and mitigate DDoS attacks for our customers, so they don’t have to. This automated approach, combined with our wide breadth of security capabilities, lets customers tailor the protection to their needs.</p><p>We've been providing <a href="/unmetered-mitigation/">unmetered and unlimited DDoS protection</a> for free to all of our customers since 2017, when we pioneered the concept. Cloudflare's mission is to help build a better Internet. A better Internet is one that is more secure, faster, and reliable for everyone - even in the face of DDoS attacks.</p> ]]></content:encoded>
            <category><![CDATA[Attacks]]></category>
            <category><![CDATA[Trends]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[DDoS]]></category>
            <category><![CDATA[Botnet]]></category>
            <guid isPermaLink="false">4Z0r3SJQWb9Ja607hPbCW0</guid>
            <dc:creator>Omer Yoachimik</dc:creator>
            <dc:creator>Julien Desgats</dc:creator>
            <dc:creator>Alex Forster</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare is joining the AS112 project to help the Internet deal with misdirected DNS queries]]></title>
            <link>https://blog.cloudflare.com/the-as112-project/</link>
            <pubDate>Thu, 15 Dec 2022 14:00:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare is participating in the AS112 project, becoming an operator of the loosely coordinated, distributed sink of the reverse lookup (PTR) queries for RFC 1918 addresses, dynamic DNS updates and other ambiguous addresses. ]]></description>
            <content:encoded><![CDATA[ <p><i></i></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4tZd1TslTV8TrWBKEVNuyC/35c4b6994eacbafc2d95970133781d0b/image2-32.png" />
            
            </figure><p>Today, we’re excited to announce that Cloudflare is participating in the <a href="https://www.as112.net/">AS112 project</a>, becoming an operator of this community-operated, loosely-coordinated anycast deployment of DNS servers that primarily answer reverse DNS lookup queries that are misdirected and create significant, unwanted load on the Internet.</p><p>With the addition of Cloudflare global network, we can make huge improvements to the stability, reliability and performance of this distributed public service.</p>
    <div>
      <h2>What is AS112 project</h2>
      <a href="#what-is-as112-project">
        
      </a>
    </div>
    <p>The AS112 project is a community effort to run an important network service intended to handle reverse DNS lookup queries for private-only use addresses that should never appear in the public DNS system. In the seven days leading up to publication of this blog post, for example, Cloudflare’s 1.1.1.1 resolver received more than 98 billion of these queries -- <i>all of which have no useful answer in the </i><a href="https://www.cloudflare.com/learning/dns/what-is-dns/"><i>Domain Name System</i></a>.</p><p>Some history is useful for context. Internet Protocol (IP) addresses are essential to network communication. Many networks make use of IPv4 addresses that are reserved for private use, and devices in the network are able to connect to the Internet with the use of network address translation (NAT), a process that maps one or more local private addresses to one or more global IP addresses and vice versa before transferring the information.</p><p>Your home Internet router most likely does this for you. You will likely find that, when at home, your computer has an IP address like 192.168.1.42. That’s an example of a private use address that is fine to use at home, but can’t be used on the public Internet. Your home router translates it, through NAT, to an address your ISP assigned to your home and that can be used on the Internet.</p><p>Here are the reserved “private use” addresses designated in <a href="https://www.rfc-editor.org/rfc/rfc1918">RFC 1918</a>.</p><table>
<thead>
  <tr>
    <th>Address block</th>
    <th>Address range</th>
    <th>Number of addresses</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>10.0.0.0/8</td>
    <td>10.0.0.0 – 10.255.255.255</td>
    <td>16,777,216</td>
  </tr>
  <tr>
    <td>172.16.0.0/12</td>
    <td>172.16.0.0 – 172.31.255.255</td>
    <td>1,048,576</td>
  </tr>
  <tr>
    <td>192.168.0.0/16</td>
    <td>192.168.0.0 – 192.168.255.255</td>
    <td>65,536</td>
  </tr>
</tbody>
</table>
<small>(Reserved private IPv4 network ranges)</small><p>Although the reserved addresses themselves are blocked from ever appearing on the public Internet, devices and programs in private environments may occasionally originate DNS queries corresponding to those addresses. These are called “reverse lookups'' because they ask the DNS if there is a name associated with an address.</p>
    <div>
      <h3>Reverse DNS lookup</h3>
      <a href="#reverse-dns-lookup">
        
      </a>
    </div>
    <p>A reverse DNS lookup is an opposite process of the more commonly used DNS lookup (which is used every day to translate a name like <a href="http://www.cloudflare.com">www.cloudflare.com</a> to its corresponding IP address). It is a query to look up the <a href="https://www.cloudflare.com/learning/dns/glossary/what-is-a-domain-name/">domain name</a> associated with a given IP address, in particular those addresses associated with routers and switches. For example, network administrators and researchers use reverse lookups to help understand paths being taken by data packets in the network, and it’s much easier to understand meaningful names than a meaningless number.</p><p>A reverse lookup is accomplished by querying DNS servers for a pointer record (<a href="https://www.cloudflare.com/learning/dns/dns-records/dns-ptr-record/">PTR</a>). PTR records store IP addresses with their segments reversed, and by appending ".in-addr.arpa" to the end. For example, the IP address 192.0.2.1 will have the PTR record stored as 1.2.0.192.in-addr.arpa. In IPv6, PTR records are stored within the ".ip6.arpa" domain instead of ".in-addr.arpa.". Below are some query examples using the dig command line tool.</p>
            <pre><code># Lookup the domain name associated with IPv4 address 172.64.35.46
# “+short” option make it output the short form of answers only
$ dig @1.1.1.1 PTR 46.35.64.172.in-addr.arpa +short
hunts.ns.cloudflare.com.

# Or use the shortcut “-x” for reverse lookups
$ dig @1.1.1.1 -x 172.64.35.46 +short
hunts.ns.cloudflare.com.

# Lookup the domain name associated with IPv6 address 2606:4700:58::a29f:2c2e
$ dig @1.1.1.1 PTR e.2.c.2.f.9.2.a.0.0.0.0.0.0.0.0.0.0.0.0.8.5.0.0.0.0.7.4.6.0.6.2.ip6.arpa. +short
hunts.ns.cloudflare.com.

# Or use the shortcut “-x” for reverse lookups
$ dig @1.1.1.1 -x 2606:4700:58::a29f:2c2e +short  
hunts.ns.cloudflare.com.</code></pre>
            
    <div>
      <h3>The problem that private use addresses cause for DNS</h3>
      <a href="#the-problem-that-private-use-addresses-cause-for-dns">
        
      </a>
    </div>
    <p>The private use addresses concerned have only local significance and cannot be resolved by the public DNS. In other words, there is no way for the public DNS to provide a useful answer to a question that has no global meaning. It is therefore a good practice for network administrators to ensure that queries for private use addresses are answered locally. However, it is not uncommon for such queries to follow the normal delegation path in the public DNS instead of being answered within the network. That creates unnecessary load.</p><p>By definition of being private use, they have no ownership in the public sphere, so there are no authoritative DNS servers to answer the queries. At the very beginning, root servers respond to all these types of queries since they serve the IN-ADDR.ARPA zone.</p><p>Over time, due to the wide deployment of private use addresses and the continuing growth of the Internet, traffic on the IN-ADDR.ARPA DNS infrastructure grew and the load due to these junk queries started to cause some concern. Therefore, the idea of offloading IN-ADDR.ARPA queries related to private use addresses was proposed. Following that, the use of anycast for distributing authoritative DNS service for that idea was subsequently proposed at a private meeting of root server operators. And eventually the AS112 service was launched to provide an alternative target for the junk.</p>
    <div>
      <h3>The AS112 project is born</h3>
      <a href="#the-as112-project-is-born">
        
      </a>
    </div>
    <p>To deal with this problem, the Internet community set up special DNS servers called “blackhole servers” as the authoritative name servers that respond to the reverse lookup of the private use address blocks 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 and the link-local address block 169.254.0.0/16 (which also has only local significance). Since the relevant zones are directly delegated to the blackhole servers, this approach has come to be known as Direct Delegation.</p><p>The first two blackhole servers set up by the project are: blackhole-1.iana.org and blackhole-2.iana.org.</p><p>Any server, including DNS name server, needs an IP address to be reachable. The IP address must also be associated with an Autonomous System Number (ASN) so that networks can recognize other networks and route data packets to the IP address destination. To solve this problem, a new authoritative DNS service would be created but, to make it work, the community would have to designate IP addresses for the servers and, to facilitate their availability, an AS number that network operators could use to reach (or provide) the new service.</p><p>The selected AS number (provided by American Registry for Internet Numbers) and namesake of the project, was 112. It was started by a small subset of root server operators, later grown to a group of volunteer name server operators that include many other organizations. They run anycasted instances of the blackhole servers that, together, form a distributed sink for the reverse DNS lookups for private network and link-local addresses sent to the public Internet.</p><p>A reverse DNS lookup for a private use address would see responses like in the example below, where the name server blackhole-1.iana.org is authoritative for it and says the name does not exist, represented in DNS responses by <b>NXDOMAIN</b>.</p>
            <pre><code>$ dig @blackhole-1.iana.org -x 192.168.1.1 +nord

;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NXDOMAIN, id: 23870
;; flags: qr aa; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;1.1.168.192.in-addr.arpa.	IN	PTR

;; AUTHORITY SECTION:
168.192.in-addr.arpa.	10800	IN	SOA	168.192.in-addr.arpa. nobody.localhost. 42 86400 43200 604800 10800</code></pre>
            <p>At the beginning of the project, node operators set up the service in the direct delegation fashion (<a href="https://datatracker.ietf.org/doc/html/rfc7534">RFC 7534</a>). However, adding delegations to this service requires all AS112 servers to be updated, which is difficult to ensure in a system that is only loosely-coordinated. An alternative approach using DNAME redirection was subsequently introduced by <a href="https://datatracker.ietf.org/doc/html/rfc7535">RFC 7535</a> to allow new zones to be added to the system without reconfiguring the blackhole servers.</p>
    <div>
      <h4><b>Direct delegation</b></h4>
      <a href="#direct-delegation">
        
      </a>
    </div>
    <p>DNS zones are directly delegated to the blackhole servers in this approach.</p><p><a href="https://datatracker.ietf.org/doc/html/rfc7534">RFC 7534</a> defines the static set of reverse lookup zones for which AS112 name servers should answer authoritatively. They are as follows:</p><ul><li><p>10.in-addr-arpa</p></li><li><p>16.172.in-addr.arpa</p></li><li><p>17.172.in-addr.arpa</p></li><li><p>18.172.in-addr.arpa</p></li><li><p>19.172.in-addr.arpa</p></li><li><p>20.172.in-addr.arpa</p></li><li><p>21.172.in-addr.arpa</p></li><li><p>22.172.in-addr.arpa</p></li><li><p>23.172.in-addr.arpa</p></li><li><p>24.172.in-addr.arpa</p></li><li><p>25.172.in-addr.arpa</p></li><li><p>26.172.in-addr.arpa</p></li><li><p>27.172.in-addr.arpa</p></li><li><p>28.172.in-addr.arpa</p></li><li><p>29.172.in-addr.arpa</p></li><li><p>30.172.in-addr.arpa</p></li><li><p>31.172.in-addr.arpa</p></li><li><p>168.192.in-addr.arpa</p></li><li><p>254.169.in-addr.arpa (corresponding to the IPv4 link-local address block)</p></li></ul><p>Zone files for these zones are quite simple because essentially they are empty apart from the required  SOA and NS records. A template of the zone file is defined as:</p>
            <pre><code>  ; db.dd-empty
   ;
   ; Empty zone for direct delegation AS112 service.
   ;
   $TTL    1W
   @  IN  SOA  prisoner.iana.org. hostmaster.root-servers.org. (
                                  1         ; serial number
                                  1W      ; refresh
                                  1M      ; retry
                                  1W      ; expire
                                  1W )    ; negative caching TTL
   ;
          NS     blackhole-1.iana.org.
          NS     blackhole-2.iana.org.</code></pre>
            <p>IP addresses of the direct delegation name servers are covered by the single IPv4 prefix 192.175.48.0/24 and the IPv6 prefix 2620:4f:8000::/48.</p><table>
<thead>
  <tr>
    <th>Name server</th>
    <th>IPv4 address</th>
    <th>IPv6 address</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>blackhole-1.iana.org</td>
    <td>192.175.48.6</td>
    <td>2620:4f:8000::6</td>
  </tr>
  <tr>
    <td>blackhole-2.iana.org</td>
    <td>192.175.48.42</td>
    <td>2620:4f:8000::42</td>
  </tr>
</tbody>
</table>
    <div>
      <h4><b>DNAME redirection</b></h4>
      <a href="#dname-redirection">
        
      </a>
    </div>
    <p>Firstly, what is DNAME? Introduced by <a href="https://www.rfc-editor.org/rfc/rfc6672">RFC 6672</a>, a DNAME record or Delegation Name Record creates an alias for an entire subtree of the domain name tree. In contrast, the CNAME record creates an alias for a single name and not its subdomains. For a received DNS query, the DNAME record instructs the name server to substitute all those appearing in the left hand (owner name) with the right hand (alias name). The substituted query name, like the CNAME, may live within the zone or may live outside the zone.</p><p>Like the CNAME record, the DNS lookup will continue by retrying the lookup with the substituted name. For example, if there are two DNS zone as follows:</p>
            <pre><code># zone: example.com
www.example.com.	A		203.0.113.1
foo.example.com.	DNAME	example.net.

# zone: example.net
example.net.		A		203.0.113.2
bar.example.net.	A		203.0.113.3</code></pre>
            <p>The query resolution scenarios would look like this:</p><table>
<thead>
  <tr>
    <th>Query (Type + Name)</th>
    <th>Substitution</th>
    <th>Final result</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>A www.example.com</td>
    <td>(no DNAME, don’t apply)</td>
    <td>203.0.113.1</td>
  </tr>
  <tr>
    <td>DNAME foo.example.com</td>
    <td>(don’t apply to the owner name itself)</td>
    <td>example.net</td>
  </tr>
  <tr>
    <td>A foo.example.com</td>
    <td>(don’t apply to the owner name itself)</td>
    <td>&lt;NXDOMAIN&gt;</td>
  </tr>
  <tr>
    <td>A bar.foo.example.com</td>
    <td>bar.example.net</td>
    <td>203.0.113.2</td>
  </tr>
</tbody>
</table><p><a href="https://datatracker.ietf.org/doc/html/rfc7535">RFC 7535</a> specifies adding another special zone, empty.as112.arpa, to support DNAME redirection for AS112 nodes. When there are new zones to be added, there is no need for AS112 node operators to update their configuration: instead, the zones’ parents will set up DNAME records for the new domains with the target domain empty.as112.arpa. The redirection (which can be cached and reused) causes clients to send future queries to the blackhole server that is authoritative for the target zone.</p><p>Note that blackhole servers do not have to support DNAME records themselves, but they do need to configure the new zone to which root servers will redirect queries at. Considering there may be existing node operators that do not update their name server configuration for some reasons and in order to not cause interruption to the service, the zone was delegated to a new blackhole server instead - blackhole.as112.arpa.</p><p>This name server uses a new pair of IPv4 and IPv6 addresses, 192.31.196.1 and 2001:4:112::1, so queries involving DNAME redirection will only land on those nodes operated by entities that also set up the new name server. Since it is not necessary for all AS112 participants to reconfigure their servers to serve empty.as112.arpa from this new server for this system to work, it is compatible with the loose coordination of the system as a whole.</p><p>The zone file for empty.as112.arpa is defined as:</p>
            <pre><code>   ; db.dr-empty
   ;
   ; Empty zone for DNAME redirection AS112 service.
   ;
   $TTL    1W
   @  IN  SOA  blackhole.as112.arpa. noc.dns.icann.org. (
                                  1         ; serial number
                                  1W      ; refresh
                                  1M      ; retry
                                  1W      ; expire
                                  1W )    ; negative caching TTL
   ;
          NS     blackhole.as112.arpa.</code></pre>
            <p>The addresses of the new DNAME redirection name server are covered by the single IPv4 prefix 192.31.196.0/24 and the IPv6 prefix 2001:4:112::/48.</p><table>
<thead>
  <tr>
    <th>Name server</th>
    <th>IPv4 address</th>
    <th>IPv6 address</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>blackhole.as112.arpa</td>
    <td>192.31.196.1</td>
    <td>2001:4:112::1</td>
  </tr>
</tbody>
</table>
    <div>
      <h4><b>Node identification</b></h4>
      <a href="#node-identification">
        
      </a>
    </div>
    <p><a href="https://datatracker.ietf.org/doc/html/rfc7534">RFC 7534</a> recommends every AS112 node also to host the following metadata zones as well: hostname.as112.net and hostname.as112.arpa.</p><p>These zones only host TXT records and serve as identifiers for querying metadata information about an AS112 node. At Cloudflare nodes, the zone files look like this:</p>
            <pre><code>$ORIGIN hostname.as112.net.
;
$TTL    604800
;
@       IN  SOA     ns3.cloudflare.com. dns.cloudflare.com. (
                       1                ; serial number
                       604800           ; refresh
                       60               ; retry
                       604800           ; expire
                       604800 )         ; negative caching TTL
;
            NS      blackhole-1.iana.org.
            NS      blackhole-2.iana.org.
;
            TXT     "Cloudflare DNS, &lt;DATA_CENTER_AIRPORT_CODE&gt;"
            TXT     "See http://www.as112.net/ for more information."
;

$ORIGIN hostname.as112.arpa.
;
$TTL    604800
;
@       IN  SOA     ns3.cloudflare.com. dns.cloudflare.com. (
                       1                ; serial number
                       604800           ; refresh
                       60               ; retry
                       604800           ; expire
                       604800 )         ; negative caching TTL
;
            NS      blackhole.as112.arpa.
;
            TXT     "Cloudflare DNS, &lt;DATA_CENTER_AIRPORT_CODE&gt;"
            TXT     "See http://www.as112.net/ for more information."
;</code></pre>
            
    <div>
      <h2>Helping AS112 helps the Internet</h2>
      <a href="#helping-as112-helps-the-internet">
        
      </a>
    </div>
    <p>As the AS112 project helps reduce the load on public DNS infrastructure, it plays a vital role in maintaining the stability and efficiency of the Internet. Being a part of this project aligns with Cloudflare’s mission to help build a better Internet.</p><p>Cloudflare is one of the fastest global anycast networks on the planet, and operates one of the largest, highly performant and reliable DNS services. We run authoritative DNS for millions of Internet properties globally. We also operate the privacy- and performance-focused public DNS resolver 1.1.1.1 service. Given our network presence and scale of operations, we believe we can make a meaningful contribution to the AS112 project.</p>
    <div>
      <h2>How we built it</h2>
      <a href="#how-we-built-it">
        
      </a>
    </div>
    <p>We’ve publicly talked about the Cloudflare in-house built authoritative DNS server software, rrDNS, several times in the past, but haven’t talked much about the software we built to power the Cloudflare public resolver - 1.1.1.1. This is an opportunity to shed some light on the technology we used to build 1.1.1.1, because this AS112 service is built on top of the same platform.</p>
    <div>
      <h3>A platform for DNS workloads</h3>
      <a href="#a-platform-for-dns-workloads">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5ezojvBvFXv64k6SUenjVH/2d39e517025c093302b393d90debf668/image1-32.png" />
            
            </figure><p>We’ve created a platform to run DNS workloads. Today, it powers 1.1.1.1, 1.1.1.1 for Families, Oblivious DNS over HTTPS (ODoH), Cloudflare WARP and Cloudflare Gateway.</p><p>The core part of the platform is a non-traditional DNS server, which has a built-in DNS recursive resolver and a forwarder to forward queries to other servers. It consists of four key modules:</p><ol><li><p>A highly efficient listener module that accepts connections for incoming requests.</p></li><li><p>A query router module that decides how a query should be resolved.</p></li><li><p>A conductor module that figures out the best way of exchanging DNS messages with upstream servers.</p></li><li><p>A sandbox environment to host guest applications.</p></li></ol><p>The DNS server itself doesn’t include any business logic, instead the guest applications run in the sandbox environment can implement concrete business logic such as request filtering, query processing, logging, attack mitigation, cache purging, etc.</p><p>The server is written in Rust and the sandbox environment is built on top of a WebAssembly runtime. The combination of Rust and WebAssembly allow us to implement high efficient connection handling, request filtering and query dispatching modules, while having the flexibility of implementing custom business logic in a safe and efficient manner.</p><p>The host exposes a set of APIs, called hostcalls, for the guest applications to accomplish a variety of tasks. You can think of them like syscalls on Linux. Here are few examples functions provided by the hostcalls:</p><ul><li><p>Obtain the current UNIX timestamp</p></li><li><p>Lookup geolocation data of IP addresses</p></li><li><p>Spawn async tasks</p></li><li><p>Create local sockets</p></li><li><p>Forward DNS queries to designated servers</p></li><li><p>Register callback functions of the sandbox hooks</p></li><li><p>Read current request information, and write responses</p></li><li><p>Emit application logs, metric data points and tracing spans/events</p></li></ul><p>The DNS request lifecycle is broken down into phases. A request phase is a point in processing at which sandboxed apps can be called to change the course of request resolution. And each guest application can register callbacks for each phase.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4qQfSG8CCIgFK2qLoO53yw/76dc10939b88d5efb9c4a7cb2e273ee9/image3-20.png" />
            
            </figure>
    <div>
      <h3>AS112 guest application</h3>
      <a href="#as112-guest-application">
        
      </a>
    </div>
    <p>The AS112 service is built as a guest application written in Rust and compiled to WebAssembly. The zones listed in <a href="https://www.rfc-editor.org/rfc/rfc7534">RFC 7534</a> and <a href="https://www.rfc-editor.org/rfc/rfc7535">RFC 7535</a> are loaded as static zones in memory and indexed as a tree data structure. Incoming queries are answered locally by looking up entries in the zone tree.</p><p>A router setting in the app manifest is added to tell the host what kind of DNS queries should be processed by the guest application, and a fallback_action setting is added to declare the expected fallback behavior.</p>
            <pre><code># Declare what kind of queries the app handles.
router = [
    # The app is responsible for all the AS112 IP prefixes.
    "dst in { 192.31.196.0/24 192.175.48.0/24 2001:4:112::/48 2620:4f:8000::/48 }",
]

# If the app fails to handle the query, servfail should be returned.
fallback_action = "fail"</code></pre>
            <p>The guest application, along with its manifest, is then compiled and deployed through a deployment pipeline that leverages <a href="/introducing-quicksilver-configuration-distribution-at-internet-scale/">Quicksilver</a> to store and replicate the assets worldwide.</p><p>The guest application is now up and running, but how does the DNS query traffic destined to the new IP prefixes reach the DNS server? Do we have to restart the DNS server every time we add a new guest application? Of course there is no need. We use software we developed and deployed earlier, called <a href="/tubular-fixing-the-socket-api-with-ebpf/">Tubular</a>. It allows us to change the addresses of a service on the fly. With the help of Tubular, incoming packets destined to the AS112 service IP prefixes are dispatched to the right DNS server process without the need to make any change or release of the DNS server itself.</p><p>Meanwhile, in order to make the misdirected DNS queries land on the Cloudflare network in the first place, we use <a href="https://developers.cloudflare.com/byoip/">BYOIP</a> (Bringing Your Own IPs to Cloudflare), a Cloudflare product that can announce customer’s own IP prefixes in all our locations. The four AS112 IP prefixes are boarded onto the BYOIP system, and will be announced by it globally.</p>
    <div>
      <h3>Testing</h3>
      <a href="#testing">
        
      </a>
    </div>
    <p>How can we ensure the service we set up does the right thing before we announce it to the public Internet? 1.1.1.1 processes more than 13 billion of these misdirected queries every day, and it has logic in place to directly return NXDOMAIN for them locally, which is a recommended practice per <a href="https://www.rfc-editor.org/rfc/rfc7534">RFC 7534</a>.</p><p>However, we are able to use a dynamic rule to change how the misdirected queries are handled in Cloudflare testing locations. For example, a rule like following:</p><blockquote><p><code>phase = post-cache and qtype in { PTR } and colo in { test1 test2 } and qname-suffix in { 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in-addr.arpa 22.172.in-addr.arpa 23.172.in-addr.arpa 24.172.in-addr.arpa 25.172.in-addr.arpa 26.172.in-addr.arpa 27.172.in-addr.arpa 28.172.in-addr.arpa 29.172.in-addr.arpa 30.172.in-addr.arpa 31.172.in-addr.arpa 168.192.in-addr.arpa 254.169.in-addr.arpa } forward 192.175.48.6:53</code></p></blockquote><p>The rule instructs that in data center test1 and test2, when the DNS query type is PTR, and the query name ends with those in the list, forward the query to server 192.175.48.6 (one of the AS112 service IPs) on port 53.</p><p>Because we’ve provisioned the AS112 IP prefixes in the same node, the new AS112 service will receive the queries and respond to the resolver.</p><p>It's worth mentioning that the above-mentioned dynamic rule that intercepts a query at the post-cache phase, and changes how the query gets processed, is executed by a guest application too, which is named override. This app loads all dynamic rules, parses the DSL texts and registers callback functions at phases declared by each rule. And when an incoming query matches the expressions, it executes the designated actions.</p>
    <div>
      <h2>Public reports</h2>
      <a href="#public-reports">
        
      </a>
    </div>
    <p>We collect the following metrics to generate the public statistics that an AS112 operator is expected to share to the operator community:</p><ul><li><p>Number of queries by query type</p></li><li><p>Number of queries by response code</p></li><li><p>Number of queries by protocol</p></li><li><p>Number of queries by IP versions</p></li><li><p>Number of queries with EDNS support</p></li><li><p>Number of queries with DNSSEC support</p></li><li><p>Number of queries by ASN/Data center</p></li></ul><p>We’ll serve the public statistics page on the <a href="https://radar.cloudflare.com/">Cloudflare Radar</a> website. We are still working on implementing the required backend API and frontend of the page – we’ll share the link to this page once it is available.</p>
    <div>
      <h2>What’s next?</h2>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>We are going to announce the AS112 prefixes starting December 15, 2022.</p><p>After the service is launched, you can run a dig command to check if you are hitting an AS112 node operated by Cloudflare, like:</p>
            <pre><code>$ dig @blackhole-1.iana.org TXT hostname.as112.arpa +short

"Cloudflare DNS, SFO"
"See http://www.as112.net/ for more information."</code></pre>
            <p></p> ]]></content:encoded>
            <category><![CDATA[Impact Week]]></category>
            <category><![CDATA[DNS]]></category>
            <category><![CDATA[Resolver]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Privacy]]></category>
            <guid isPermaLink="false">1zMRKaFO35qhbwDRWx115i</guid>
            <dc:creator>Hunts Chen</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare Pages gets even faster with Early Hints]]></title>
            <link>https://blog.cloudflare.com/early-hints-on-cloudflare-pages/</link>
            <pubDate>Fri, 07 Oct 2022 13:00:00 GMT</pubDate>
            <description><![CDATA[ Announcing support for sending Early Hints from your Cloudflare Pages projects ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Last year, we demonstrated what we meant by “lightning fast”, <a href="/cloudflare-pages-is-lightning-fast/">showing Pages' first-class performance</a> in all parts of the world, and today, we’re thrilled to announce an integration that takes this commitment to speed even further – introducing Pages support for Early Hints! Early Hints allow you to unblock the loading of page critical resources, ahead of any slow-to-deliver HTML pages. Early Hints can be used to improve the loading experience for your visitors by significantly reducing key performance metrics such as the largest contentful paint (LCP).</p>
    <div>
      <h2>What is Early Hints?</h2>
      <a href="#what-is-early-hints">
        
      </a>
    </div>
    <p><a href="/early-hints/">Early Hints</a> is a new feature of the Internet which is <a href="https://developer.chrome.com/blog/early-hints/#implementing-early-hints">supported in Chrome since version 103</a>, and that <a href="/early-hints-performance/">Cloudflare made generally available</a> for websites using our network. Early Hints supersedes <a href="https://groups.google.com/a/chromium.org/g/blink-dev/c/K3rYLvmQUBY/m/vOWBKZGoAQAJ">Server Push</a> as a mechanism to "hint" to a browser about critical resources on your page (e.g. fonts, CSS, and above-the-fold images). The browser can immediately start loading these resources before waiting for a full HTML response. This uses time that was otherwise previously wasted! Before Early Hints, no work could be started until the browser received the first byte of the response. Now, the browser can fill this time usefully when it was previously sat waiting. Early Hints can bring significant improvements to the performance of your website, particularly for metrics such as LCP.</p>
    <div>
      <h3>How Early Hints works</h3>
      <a href="#how-early-hints-works">
        
      </a>
    </div>
    <p>Cloudflare caches any <code>preload</code> and <code>preconnect</code> type <code>Link</code> headers sent from your 200 OK response, and sends them early for any subsequent requests as a 103 Early Hints response.</p><p>In practical terms, an HTTP conversation now looks like this:</p><p><b>Request</b></p>
            <pre><code>GET /
Host: example.com</code></pre>
            <p><b>Early Hints Response</b></p>
            <pre><code>103 Early Hints
Link: &lt;/styles.css&gt;; rel=preload; as=style</code></pre>
            <p><b>Response</b></p>
            <pre><code>200 OK
Content-Type: text/html; charset=utf-8
Link: &lt;/styles.css&gt;; rel=preload; as=style

&lt;html&gt;
&lt;!-- ... --&gt;
&lt;/html&gt;</code></pre>
            
    <div>
      <h2>Early Hints on Cloudflare Pages</h2>
      <a href="#early-hints-on-cloudflare-pages">
        
      </a>
    </div>
    <p>Websites hosted on Cloudflare Pages can particularly benefit from Early Hints. If you're using <a href="/cloudflare-pages-goes-full-stack/">Pages Functions</a> to generate dynamic server-side rendered (SSR) pages, there's a good chance that Early Hints will make a significant improvement on your website.</p>
    <div>
      <h3>Performance Testing</h3>
      <a href="#performance-testing">
        
      </a>
    </div>
    <p>We created a simple demonstration e-commerce website in order to evaluate the performance of Early Hints.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/77w2Mw6t1Oku0C2uFulZvH/09416e738ac559f7977e8d76614ad0af/image2-7.png" />
            
            </figure><p>This landing page has the price of each item, as well as a remaining stock counter. The page itself is just hand-crafted HTML and CSS, but these pricing and inventory values are being templated in live for every request with <a href="https://developers.cloudflare.com/pages/platform/functions/">Pages Functions</a>. To simulate loading from an external data-source (possibly backed by <a href="https://developers.cloudflare.com/workers/runtime-apis/kv/">KV</a>, <a href="https://developers.cloudflare.com/workers/runtime-apis/durable-objects/">Durable Objects</a>, <a href="/introducing-d1/">D1</a>, or even an external API like Shopify) we've added a fixed delay before this data resolves. We include <code>preload</code> links in our response to some critical resources:</p><ul><li><p>an external CSS stylesheet,</p></li><li><p>the image of the t-shirt,</p></li><li><p>the image of the cap,</p></li><li><p>and the image of the keycap.</p></li></ul><p>The very first request makes a waterfall like you might expect. The first request is held blocked for a considerable amount of time while we resolve this pricing and inventory data. Once loaded, the browser parses the HTML, pulls out the external resources, and makes subsequent requests for their contents. The CSS and images extend the loading time considerably given their large dimensions and high quality. The largest contentful paint (LCP) occurs when the t-shirt image loads, and the document finishes once all requests are fulfilled.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/24N9FzqlRfCtlSGuPlUPic/8650a76a958f4946e20c6680cb01ac84/image1-10.png" />
            
            </figure><p>Subsequent requests are where things get interesting! These <code>preload</code> links are cached on Cloudflare's global network, and are sent ahead of the document in a 103 Early Hints response. Now, the waterfall looks much different. The initial request goes out the same, but now, requests for the CSS and images slide much further left since they can be started as soon as the 103 response is delivered. The browser starts fetching those resources while waiting for the original request to finish server-side rendering. The LCP again occurs once the t-shirt image has loaded, but this time, it's brought forward by <b>530ms</b> because it started loading <b>752ms</b> faster, and the document is fully loaded <b>562ms</b> faster, again because the external resources could all start loading faster.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2Z05bcWVJtHoo9kkgl6IJj/941868fd08a160c81c61be2590b19107/image3-3.png" />
            
            </figure><p>The final four requests (highlighted in yellow) come back as 304 Not Modified responses using a <code>If-None-Match</code> header. By default, Cloudflare Pages requires the browser to confirm that all assets are fresh, and so, on the off chance that they were updated between the Early Hints response and when they come to being used, the browser is checking if they have changed. Since they haven't, there's no contentful body to download, and the response completes quickly. This can be avoided by setting a custom <code>Cache-Control</code> header on these assets using <a href="https://developers.cloudflare.com/pages/platform/headers/">a <code>_headers</code> file</a>. For example, you could cache these images for one minute with a rule like:</p>
            <pre><code># _headers

/*.png
  Cache-Control: max-age=60</code></pre>
            <p>We could take this performance audit further by exploring other features that Cloudflare offers, such as <a href="https://support.cloudflare.com/hc/en-us/articles/200168196">automatic CSS minification</a>, <a href="https://developers.cloudflare.com/images/">Cloudflare Images</a>, and <a href="https://developers.cloudflare.com/images/image-resizing/">Image Resizing</a>.</p><p>We already serve Cloudflare Pages from <a href="/cloudflare-pages-is-lightning-fast/">one of the fastest networks in the world</a> — Early Hints simply allows developers to take advantage of our global network even further.</p>
    <div>
      <h2>Using Early Hints and Cloudflare Pages</h2>
      <a href="#using-early-hints-and-cloudflare-pages">
        
      </a>
    </div>
    <p>The Early Hints feature on Cloudflare is currently restricted to caching <code>Link</code> headers in a webpage's response. Typically, this would mean that Cloudflare Pages users would either need to use the <code>_headers</code> file, or Pages Functions to apply these headers. However, for your convenience, we've also added support to transform any <code>&lt;link&gt;</code> HTML elements you include in your body into <code>Link</code> headers. This allows you to directly control the Early Hints you send, straight from the same document where you reference these resources – no need to come out of HTML to take advantage of Early Hints.</p><p>For example, for the following HTML document, will generate an Early Hints response:</p><p><b>HTML Document</b></p>
            <pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;link rel="preload" as="style" href="/styles.css" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;!-- ... --&gt;
  &lt;/body&gt;
&lt;/html&gt;</code></pre>
            <p><b>Early Hints Response</b></p>
            <pre><code>103 Early Hints
Link: &lt;/styles.css&gt;; rel=preload; as=style</code></pre>
            <p>As previously mentioned, <code>Link</code> headers can also be set with a <a href="/custom-headers-for-pages/"><code>_headers</code> file</a> if you prefer:</p>
            <pre><code># _headers

/
  Link: &lt;/styles.css&gt;; rel=preload; as=style</code></pre>
            <p>Early Hints (and the automatic HTML <code>&lt;link&gt;</code> parsing) has already been enabled automatically for all <code>pages.dev</code> domains. If you have any custom domains configured on your Pages project, make sure to enable Early Hints on that domain in the Cloudflare dashboard under the "Speed" tab. More information can be found in our <a href="https://developers.cloudflare.com/pages/platform/early-hints/">documentation</a>.</p><p>Additionally, in the future, we hope to support the Smart Early Hints features. Smart Early Hints will enable Cloudflare to automatically generate Early Hints, even when no <code>Link</code> header or <code>&lt;link&gt;</code> elements exist, by analyzing website traffic and inferring which resources are important for a given page. We'll be sharing more about Smart Early Hints soon.</p><p>In the meantime, try out <a href="https://developers.cloudflare.com/pages/platform/early-hints/">Early Hints on Pages</a> today! Let us know how much of a loading improvement you see in <a href="https://discord.com/invite/cloudflaredev">our Discord server</a>.</p>
    <div>
      <h2>Watch on Cloudflare TV</h2>
      <a href="#watch-on-cloudflare-tv">
        
      </a>
    </div>
    <div></div><p></p> ]]></content:encoded>
            <category><![CDATA[Early Hints]]></category>
            <category><![CDATA[Cloudflare Pages]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">3XJwgZh2bmW4PvjEU8BlCg</guid>
            <dc:creator>Greg Brimble</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[Introducing Configuration Rules]]></title>
            <link>https://blog.cloudflare.com/configuration-rules/</link>
            <pubDate>Tue, 27 Sep 2022 13:00:00 GMT</pubDate>
            <description><![CDATA[ Configuration Rules is the new and improved way for Cloudflare customers to control and manipulate features that are enabled or disabled for specific requests on their zone. ]]></description>
            <content:encoded><![CDATA[ <p></p>
    <div>
      <h3>A powerful new set of tools</h3>
      <a href="#a-powerful-new-set-of-tools">
        
      </a>
    </div>
    <p>In 2012, we introduced <a href="/introducing-pagerules-fine-grained-feature-co/">Page Rules</a> to the world, announcing:</p><blockquote><p><i><b>“Page Rules is a powerful new set of tools that allows you to control how CloudFlare works on your site on a page-by-page basis.”</b></i></p></blockquote><p>Ten years later, and with all F’s lowercase, we are excited to introduce <b>Configuration Rules</b> — a Page Rules successor and a much improved way of controlling Cloudflare features and settings. With Configuration Rules, users can selectively turn on/off features which would typically be applied to every HTTP request going through the zone. They can do this based on URLs - and more, such as cookies or country of origin.</p><p>Configuration Rules opens up a wide range of use cases for our users that previously were impossible without writing custom code in a <a href="https://workers.cloudflare.com/">Cloudflare Worker</a>. Such use cases as A/B testing configuration or only enabling features for a set of file extensions are now made possible thanks to the rich filtering capabilities of the product.</p><p>Configuration Rules are available for use immediately across all plan levels.</p>
    <div>
      <h3>Turn it on, but only when…</h3>
      <a href="#turn-it-on-but-only-when">
        
      </a>
    </div>
    <p>As each HTTP request enters a Cloudflare zone we apply a configuration. This configuration tells the Cloudflare server handling the HTTP request which features the HTTP request should ‘go’ through, and with what settings/options. This is defined by the user, typically via the dashboard.</p><p>The issue arises when users want to enable these features, such as Polish or Auto Minify, only on a subset of the traffic to their website. For example, users may want to disable Email Obfuscation but only for a specific page on their website so that contact information is shown correctly to visitors. To do this, they can deploy a <b>Configuration Rule.</b></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5lCHWaSYhQ6dCCY4l7auNM/d937ed4b350a30d95f54e7fec70e46dc/image6-9.png" />
            
            </figure><p>Configuration Rules lets users selectively enable or disable features based on one or more ruleset engine <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/fields">fields</a>.</p><p>Currently, there are 16 available <i>actions</i> within Configuration Rules. These actions range from Disable Apps, Disable Railgun and Disable Zaraz to Auto Minify, Polish and Mirage.</p><p>These actions effectively ‘override’ the corresponding zone-wide setting for matching traffic. For example, Rocket Loader may be enabled for the zone <code>example.com</code>:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2pDnBa8tNufAha85zYcwuV/db55216d9fd961bacd1b2939c0253471/image1-60.png" />
            
            </figure><p>If the user, however, does not want Rocket Loader to be enabled on their checkout page due to an issue it causes with a specific JavaScript element, they could create a Configuration Rule to selectively disable Rocket Loader:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1VekSaqhCwY7LzR1X5fzxl/486a347031c530961a7e22e0796fdf00/image7-6.png" />
            
            </figure><p>This interplay between zone level settings and Configuration Rules allows users to selectively enable features, allowing them to test Rocket Loader on <code>staging.example.com</code> prior to flipping the zone-level toggle.</p><p>With Configuration Rules, users also have access to various other non-URL related fields. For example, users could use the <code>ip.geoip.country</code> <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/fields">field</a> to ensure that visitors for specific countries always have the ‘Security Level’ set to ‘I’m under attack’.</p><p>Historically, these configuration overrides were achieved with the setting of a <a href="https://support.cloudflare.com/hc/en-us/articles/218411427-Understanding-and-configuring-Cloudflare-Page-Rules-Page-Rules-Tutorial-">Page Rule</a>.</p><p>Page Rules 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’. It allows users to selectively change how traffic is handled, and in this case specifically, which settings are and aren’t applied. It is very well adopted, with over one million Page Rules in the past three months alone.</p><p>Page Rules, however, are limited to performing actions based upon the requested URL. This means if users want to disable Rocket Loader for certain traffic, they need to make that decision based on the URL alone. This can be challenging for users who may want to perform this decision-making on more nuanced aspects, like the user agent of the visitor or on the presence of a specific cookie.</p><p>For example, users might want to set the ‘Security Level’ to ‘I'm under attack’ when the HTTP request originates in certain countries. This is where Configuration Rules help.</p>
    <div>
      <h3>Use case: A/B testing</h3>
      <a href="#use-case-a-b-testing">
        
      </a>
    </div>
    <p>A/B testing is the term used to describe the comparison of two versions of a single website or application. It allows users to create a copy of their current website (‘A’), change it (‘B’) and compare the difference.</p><p>In a Cloudflare context, users might want to A/B test the effect of features such as Mirage or Polish prior to enabling them for all traffic to the website. With Page Rules, this was impractical. Users would have to create Page Rules matching on specific URI query strings and A/B test by appending those query strings to every HTTP request.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4sDX4fz5R0yYVwYjGOHqIR/b3c74589103361deb70e6b41d03c4b5d/image2-51.png" />
            
            </figure><p>With Configuration Rules, this task is much simpler. Leveraging one or more <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/fields">fields</a>, users can filter on other parameters of a HTTP request to define which features and products to enable.</p><p>For example, by using the expression <code>any(http.request.cookies["app"][*] == "test")</code> a user can ensure that Auto Minify, Mirage and Polish are enabled only when this cookie is present on the HTTP request. This allows comparison testing to happen before enabling these products either globally, or on a wider set of traffic. All without impacting existing production traffic.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7xSw4yjv18WugHyW3FFUBD/0a8cd5a53cbef56107e4d1b33fdff2d6/image4-18.png" />
            
            </figure>
    <div>
      <h3>Use case: augmenting URLs</h3>
      <a href="#use-case-augmenting-urls">
        
      </a>
    </div>
    <p>Configuration Rules can be used to augment existing requirements, also. One example given in <a href="/future-of-page-rules">‘The Future of Page Rules’</a> blog is increasing the Security Level to ‘High’ for visitors trying to access the contact page of a website, to reduce the number of malicious visitors to that page.</p><p>In Page Rules, this would be done by simply specifying the contact page URL and specifying the security level, e.g. URL: <code>example.com/contact*</code>. This ensures that any “visitors that exhibit threatening behavior within the last 14 days” are served with a challenge prior to having that page load.</p><p>Configuration Rules can take this use case and augment it with additional fields, such as whether the source IP address is in a Cloudflare <a href="https://developers.cloudflare.com/firewall/cf-firewall-rules/rules-lists/#managed-ip-lists">Managed IP List</a>. This allows users to be more specific about when the security level is changed to ‘High’, such as only when the request <i>also</i> is marged as coming from an open HTTP and SOCKS proxy endpoints, which are frequently used to launch attacks and hide attackers identity:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/gTfYrqfIMypitpU8oxngo/ac7f71dd2ad2bac606b87635efd9158f/image3-35.png" />
            
            </figure><p>This reduces the chance of a false positive, and a genuine visitor to the contact form being served with a challenge.</p>
    <div>
      <h3>Try it now</h3>
      <a href="#try-it-now">
        
      </a>
    </div>
    <p>Configuration Rules are available <a href="https://dash.cloudflare.com/?to=/:account/:zone/rules/">now</a> via API, UI, and Terraform for <a href="https://www.cloudflare.com/plans/">all Cloudflare plans</a>! We are excited to see how you will use them in conjunction with all our new rules releases from this week.</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Config Rules]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">TYoO5u2nlYXlMN2YAvsrL</guid>
            <dc:creator>Matt Bullock</dc:creator>
            <dc:creator>Sam Marsh</dc:creator>
        </item>
        <item>
            <title><![CDATA[Load Balancing with Weighted Pools]]></title>
            <link>https://blog.cloudflare.com/load-balancing-with-weighted-pools/</link>
            <pubDate>Tue, 02 Aug 2022 13:00:00 GMT</pubDate>
            <description><![CDATA[ Today, we’re excited to announce a frequently requested feature for our Load Balancer – Weighted Pools ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Anyone can take advantage of Cloudflare’s far-reaching network to protect and accelerate their online presence. Our vast <a href="https://www.cloudflare.com/network/">number of data centers</a>, and their proximity to Internet users around the world, enables us to secure and accelerate our customers’ Internet applications, APIs and websites. Even a simple service with a <a href="https://www.cloudflare.com/learning/cdn/glossary/origin-server/">single origin server</a> can leverage the massive scale of the Cloudflare network in 270+ cities. Using the Cloudflare cache, you can support more requests and users without purchasing new servers.</p><p>Whether it is to guarantee high availability through redundancy, or to support more dynamic content, an increasing number of services require multiple origin servers. The Cloudflare Load Balancer keeps our customer’s services highly available and makes it simple to spread out requests across multiple origin servers. Today, we’re excited to announce a frequently requested feature for our Load Balancer – Weighted Pools!</p>
    <div>
      <h2>What’s a Weighted Pool?</h2>
      <a href="#whats-a-weighted-pool">
        
      </a>
    </div>
    <p>Before we can answer that, let’s take a quick look at how our load balancer works and define a few terms:</p><p><b>Origin Servers</b> - Servers which sit behind Cloudflare and are often located in a customer-owned datacenter or at a public cloud provider.</p><p><b>Origin Pool</b> - A logical collection of origin servers. Most pools are named to represent data centers, or cloud providers like “us-east,” “las-vegas-bldg1,” or “phoenix-bldg2”. It is recommended to use pools to represent a collection of servers in the same physical location.</p><p><b>Traffic Steering Policy</b> - A policy specifies how a load balancer should steer requests across origin pools. Depending on the steering policy, requests may be sent to the nearest pool as defined by latitude and longitude, the origin pool with the lowest latency, or based upon the location of the Cloudflare data center.</p><p><b>Pool Weight</b> - A numerical value to describe what percentage of requests should be sent to a pool, relative to other pools.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6rTxNJcZUpuAep6AGouFyW/51f258c84377e710316181a3e0ce7991/image6.png" />
            
            </figure><p>When a request from a visitor arrives at the Cloudflare network for a hostname with a load balancer attached to it, the load balancer must decide where the request should be forwarded. Customers can configure this behavior with traffic steering policies.</p><p>The Cloudflare Load Balancer already supports <a href="https://developers.cloudflare.com/load-balancing/understand-basics/traffic-steering/steering-policies/">Standard Steering, Geo Steering, Dynamic Steering, and Proximity Steering</a>. Each of these respective traffic steering policies control how requests are distributed across origin pools. Weighted Pools are an extension of our standard, random steering policy which allows the specification of what relative percentage of requests should be sent to each respective pool.</p><p>In the example above, our load balancer has two origin pools, “las-vegas-bldg1” (which is a customer operated data center), and “us-east-cloud” (which is a public cloud provider with multiple virtual servers). Each pool has a weight of 0.5, so 50% of requests should be sent to each respective pool.</p>
    <div>
      <h2>Why would someone assign weights to origin pools?</h2>
      <a href="#why-would-someone-assign-weights-to-origin-pools">
        
      </a>
    </div>
    <p>Before we built this, Weighted Pools was a frequently requested feature from our customers. Part of the reason we’re so excited about this feature is that it can be used to solve many types of problems.</p>
    <div>
      <h3>Unequally Sized Origin Pools</h3>
      <a href="#unequally-sized-origin-pools">
        
      </a>
    </div>
    <p>In the example below, the amount of dynamic and uncacheable traffic has significantly increased due to a large sales promotion. Administrators notice that the load on their Las Vegas data center is too high, so they elect to dynamically increase the number of origins within their public cloud provider. Our two pools, “las-vegas-bldg1” and “us-east-cloud” are no longer equally sized. Our pool representing the public cloud provider is now much larger, so administrators change the pool weights so that the cloud pool receives 0.8 (80%) of the traffic, relative to the 0.2 (20%) of the traffic which the Las Vegas pool receives. The administrators were able to use pool weights to very quickly fine-tune the distribution of requests across unequally sized pools.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5V6rFceRK8So5AK0S7FzV9/4441a732a2581a6fe42938710e624742/image3.png" />
            
            </figure>
    <div>
      <h3>Data center kill switch</h3>
      <a href="#data-center-kill-switch">
        
      </a>
    </div>
    <p>In addition to balancing out unequal sized pools, Weighted Pools may also be used to completely take a data center (an origin pool) out of rotation by setting the pool’s weight to 0. This feature can be particularly useful if a data center needs to be quickly eliminated during troubleshooting or a proactive maintenance where power may be unavailable. Even if a pool is disabled with a weight of 0, Cloudflare will still monitor the pool for health so that the administrators can assess when it is safe to return traffic.</p>
    <div>
      <h3>Network A/B testing</h3>
      <a href="#network-a-b-testing">
        
      </a>
    </div>
    <p>One final use case we’re excited about is the ability to use weights to attract a very small amount of requests to pool. Did the team just stand up a brand-new data center, or perhaps upgrade all the servers to a new software version? Using weighted pools, the administrators can use a load balancer to effectively A/B test their network. Only send 0.05 (5%) of requests to a new pool to verify the origins are functioning properly before gradually increasing the load.</p>
    <div>
      <h2>How do I get started?</h2>
      <a href="#how-do-i-get-started">
        
      </a>
    </div>
    <p>When setting up a load balancer, you need to configure one or more origin pools, and then place origins into your respective pools. Once you have more than one pool, the relative weights of the respective pools will be used to distribute requests.</p><p>To set up a weighted pool using the Dashboard, create a load balancer in the <b>Traffic &gt; Load Balancing</b> area.</p><p>Once you have set up the load balancer, you’re navigated to the <b>Origin Pools</b> setup page. Under the Traffic Steering Policy, select <b>Random</b>, and then assign relative weights to every pool.</p><p>If your weights do not add up to 1.00 (100%), that’s fine! We will do the math behind the scenes to ensure how much traffic the pool should receive relative to other pools.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1tgWXK6Slx7C3KZdZd5SrO/de00d5b4889346a67ba6fc7b34b0e05d/image4.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7MoDiAL340j2GfFJ3KihWr/157eac63640bbd6cd11c75d8b610458b/image2.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4FjRnImOHxs5NHVZqRVG7w/ee4e4f38303dc06ee0ec1494fa65faab/image5-1.png" />
            
            </figure><p>Weighted Pools may also be configured via the API. We’ve edited an example illustrating the relevant parts of the REST API.</p><ul><li><p>The load balancer should employ a “steering_policy” of random.</p></li><li><p>Each pool has a UUID, which can then be assigned a “pool_weight.”</p></li></ul>
            <pre><code> {
    "description": "Load Balancer for www.example.com",
    "name": "www.example.com",
    "enabled": true,
    "proxied": true,
    "fallback_pool": "9290f38c5d07c2e2f4df57b1f61d4196",
    "default_pools": [
        "9290f38c5d07c2e2f4df57b1f61d4196",
        "17b5962d775c646f3f9725cbc7a53df4"
    ],
    "steering_policy": "random",
    "random_steering": {
        "pool_weights": {
            "9290f38c5d07c2e2f4df57b1f61d4196": 0.8
        },
        "default_weight": 0.2
    }
}</code></pre>
            <p>We’re excited to launch this simple, yet powerful and capable feature. Weighted pools may be utilized in tons of creative new ways to solve load balancing challenges. It’s available for all customers with load balancers today!</p><p>Developer Docs:<a href="https://developers.cloudflare.com/load-balancing/how-to/create-load-balancer/#create-a-load-balancer">https://developers.cloudflare.com/load-balancing/how-to/create-load-balancer/#create-a-load-balancer</a></p><p>API Docs:<a href="https://api.cloudflare.com/#load-balancers-create-load-balancer">https://api.cloudflare.com/#load-balancers-create-load-balancer</a></p> ]]></content:encoded>
            <category><![CDATA[Load Balancing]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Network Services]]></category>
            <category><![CDATA[Performance]]></category>
            <guid isPermaLink="false">12ylWmYVhyw4uFIG3NBqN2</guid>
            <dc:creator>Brian Batraski</dc:creator>
            <dc:creator>Ben Ritter</dc:creator>
        </item>
        <item>
            <title><![CDATA[Automatic Signed Exchanges may dramatically boost your site visitor numbers]]></title>
            <link>https://blog.cloudflare.com/automatic-signed-exchanges-desktop-android/</link>
            <pubDate>Fri, 08 Jul 2022 12:27:53 GMT</pubDate>
            <description><![CDATA[ Automatic Signed Exchanges may dramatically boost your site visitor numbers ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4mUZ1vtinqv4i8DyEobO4K/012a7dcbaca4f70e6664d8432d5374e4/pasted-image-0--4-.png" />
            
            </figure><p>It’s been about nine months since <a href="/from-amp-to-signed-exchanges-or-how-innovation-happens-at-cloudflare/">Cloudflare announced</a> support for Signed Exchanges (SXG), a <a href="https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html">web platform specification</a> to deterministically verify the cached version of a website and enable third parties such as search engines and news aggregators to serve it much faster than the origin ever could.</p><p>Giving Internet users fast load times, even on slow connections in remote parts of the globe, is to <i>help build a better Internet</i> (our mission!) and <a href="/from-amp-to-signed-exchanges-or-how-innovation-happens-at-cloudflare/">we couldn’t be more excited about the potential of SXG</a>.Signed Exchanges drive quite impressive benefits in terms of performance improvements. <a href="https://web.dev/signed-exchanges/#impact-of-signed-exchanges">Google’s experiments</a> have shown an average 300ms to 400ms reduction in <a href="https://web.dev/lcp/">Largest Contentful Paint (LCP)</a> from SXG-enabled prefetches.  <b>And speeding up your website usually results in a</b> <a href="https://www.thinkwithgoogle.com/marketing-strategies/app-and-mobile/mobile-page-speed-new-industry-benchmarks/"><b>significant bounce rate reduction</b></a> <b>and improved SEO</b>.</p><p><i>faster websites= better SEO and lower bounce rates</i></p><p>And if setting up and maintaining SXGs through the <a href="https://web.dev/signed-exchanges/#tooling">open source toolkit</a> is a complex yet very valuable endeavor, with Cloudflare’s <a href="/automatic-signed-exchanges/">Automatic Signed Exchanges</a> it becomes a no-brainer. Just enable it with one click and see for yourself.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4O7ZL4hRXnDPWWIqrP68Jr/87665ba214b9a23c13c9ac6518433d4d/pasted-image-0--5-.png" />
            
            </figure>
    <div>
      <h3>Our own measurements</h3>
      <a href="#our-own-measurements">
        
      </a>
    </div>
    <p>Now that Signed Exchanges have been available on Chromium for Android for several months we dove into the change in performance our customers have experienced in the real world.</p><p>We picked the 500 most visited sites that have Automatic Signed Exchanges enabled and saw that 425 of them (85%) saw an improvement in <a href="https://web.dev/lcp/">LCP</a>, which is widely considered as the Core Web Vital with the most impact on SEO and where SXG should make the biggest difference.</p><p>Out of those same 500 Cloudflare sites 389 (78%) saw an improvement in <a href="https://web.dev/fcp/">First Contentful Paint (FCP)</a> and a whopping 489 (98%) saw an improvement in <a href="https://web.dev/ttfb/">Time to First Byte (TTFB)</a>. The TTFB improvement measured here is an interesting case since if the exchange has already been prefetched, when the user clicks on the link the resource is already in the client browser cache and the TTFB measurement becomes close to zero.</p><p><b>Overall, the median customer saw an improvement of over 20% across these metrics. Some customers saw improvements of up to 80%.</b></p><p>There were also a few customers that did not see an improvement, or saw a slight degradation of their metrics.</p><p>One of the main reasons for this is that SXG wasn’t compatible with server-side personalization (e.g., serving different HTML for logged-in users) until today. To solve that, today Google added ‘Dynamic SXG’, that selectively enables SXG for visits from cookieless users only (more details on the Google blog post <a href="https://developer.chrome.com/blog/sxg-desktop/">here</a>). Dynamic SXG are supported today - all you need to do is add a `Vary: Cookie’ annotation to the HTTP header of pages that contain server-side personalization.</p><p><i>Note: Signed Exchanges are compatible with client-side personalization (lazy-loading).</i></p><p>To see what the <a href="https://www.cloudflare.com/learning/performance/what-are-core-web-vitals/">Core Web Vitals</a> look like for your own users across the world we recommend a RUM solution such as our free and privacy-first <a href="https://www.cloudflare.com/web-analytics/">Web Analytics</a>.</p>
    <div>
      <h3>Now available for Desktop and Android</h3>
      <a href="#now-available-for-desktop-and-android">
        
      </a>
    </div>
    <p><b>Starting today, Signed Exchanges is also supported by Chromium-based desktop browsers, including Chrome, Edge and Opera.</b></p><p>If you enabled Automatic Signed Exchanges on your Cloudflare dashboard, no further action is needed - the supported desktop browsers will automatically start being served the SXG version of your site’s content. Google estimates that this release will, on average, double SXG’s coverage of your site’s visits, enabling improved loading and performance for more users.</p><p>And if you haven’t yet enabled it but are curious about the impact SXG will have on your site, Automatic Signed Exchanges is available through the <a href="https://dash.cloudflare.com/?to=/:account/:zone/speed/optimization">Speed &gt; Optimization link</a> on your Cloudflare dashboard (more details <a href="https://support.cloudflare.com/hc/en-us/articles/4411075595661-Automatic-Signed-Exchanges-SXGs-">here</a>).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7B9QWzclctIMHPsOzHUasO/851d54a61126ea21486d96951a200716/image3.png" />
            
            </figure><p></p> ]]></content:encoded>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Signed Exchanges (SXG)]]></category>
            <category><![CDATA[SEO]]></category>
            <guid isPermaLink="false">6Me41Kp2wjTeaIi9xVwkrk</guid>
            <dc:creator>João Sousa Botto</dc:creator>
        </item>
        <item>
            <title><![CDATA[HTTP RFCs have evolved: A Cloudflare view of HTTP usage trends]]></title>
            <link>https://blog.cloudflare.com/cloudflare-view-http3-usage/</link>
            <pubDate>Mon, 06 Jun 2022 20:49:17 GMT</pubDate>
            <description><![CDATA[ HTTP/3 is now RFC 9114. We explore Cloudflare's view of how it is being used ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Today, a cluster of Internet standards were published that rationalize and modernize the definition of HTTP - the application protocol that underpins the web. This work includes updates to, and <a href="https://www.cloudflare.com/learning/cloud/how-to-refactor-applications/">refactoring</a> of, HTTP semantics, HTTP caching, HTTP/1.1, HTTP/2, and the brand-new <a href="https://www.cloudflare.com/learning/performance/what-is-http3/">HTTP/3</a>. Developing these specifications has been no mean feat and today marks the culmination of efforts far and wide, in the Internet Engineering Task Force (IETF) and beyond. We thought it would be interesting to celebrate the occasion by sharing some analysis of Cloudflare's view of HTTP traffic over the last 12 months.</p><p>However, before we get into the traffic data, for quick reference, here are the new RFCs that you should make a note of and start using:</p><ul><li><p>HTTP Semantics - <a href="https://www.rfc-editor.org/rfc/rfc9110.html">RFC 9110</a></p><ul><li><p>HTTP's overall architecture, common terminology and shared protocol aspects such as request and response messages, methods, status codes, header and trailer fields, message content, representation data, content codings and much more. Obsoletes RFCs <a href="https://www.rfc-editor.org/rfc/rfc2818.html">2818</a>, <a href="https://www.rfc-editor.org/rfc/rfc7231.html">7231</a>, <a href="https://www.rfc-editor.org/rfc/rfc7232.html">7232</a>, <a href="https://www.rfc-editor.org/rfc/rfc7233.html">7233</a>, <a href="https://www.rfc-editor.org/rfc/rfc7235.html">7235</a>, <a href="https://www.rfc-editor.org/rfc/rfc7538.html">7538</a>, <a href="https://www.rfc-editor.org/rfc/rfc7615.html">7615</a>, <a href="https://www.rfc-editor.org/rfc/rfc7694.html">7694</a>, and portions of <a href="https://www.rfc-editor.org/rfc/rfc7230.html">7230</a>.</p></li></ul></li><li><p>HTTP Caching - <a href="https://www.rfc-editor.org/rfc/rfc9111.html">RFC 9111</a></p><ul><li><p>HTTP caches and related header fields to control the behavior of response caching. Obsoletes RFC <a href="https://www.rfc-editor.org/rfc/rfc7234.html">7234</a>.</p></li></ul></li><li><p>HTTP/1.1 - <a href="https://www.rfc-editor.org/rfc/rfc9112.html">RFC 9112</a></p><ul><li><p>A syntax, aka "wire format", of HTTP that uses a text-based format. Typically used over TCP and TLS. Obsolete portions of RFC <a href="https://www.rfc-editor.org/rfc/rfc7230.html">7230</a>.</p></li></ul></li><li><p>HTTP/2 - RFC <a href="https://www.rfc-editor.org/rfc/rfc9113.html">9113</a></p><ul><li><p>A syntax of HTTP that uses a binary framing format, which provides streams to support concurrent requests and responses. Message fields can be compressed using HPACK. Typically used over TCP and TLS. Obsoletes RFCs <a href="https://www.rfc-editor.org/rfc/rfc7540.html">7540</a> and <a href="https://www.rfc-editor.org/rfc/rfc8740.html">8740</a>.</p></li></ul></li><li><p>HTTP/3 - RFC <a href="https://www.rfc-editor.org/rfc/rfc9114.html">9114</a></p><ul><li><p>A syntax of HTTP that uses a binary framing format optimized for the QUIC transport protocol. Message fields can be compressed using QPACK.</p></li></ul></li><li><p>QPACK - RFC <a href="https://www.rfc-editor.org/rfc/rfc9204.html">9204</a></p><ul><li><p>A variation of HPACK field compression that is optimized for the QUIC transport protocol.</p></li></ul></li></ul><p>On May 28, 2021, we <a href="/quic-version-1-is-live-on-cloudflare/">enabled</a> QUIC version 1 and HTTP/3 for all Cloudflare customers, using the final "h3" identifier that matches RFC 9114. So although today's publication is an occasion to celebrate, for us nothing much has changed, and it's business as usual.</p><p><a href="https://caniuse.com/http3">Support for HTTP/3 in the stable release channels of major browsers</a> came in November 2020 for Google Chrome and Microsoft Edge and April 2021 for Mozilla Firefox. In Apple Safari, HTTP/3 support currently needs to be <a href="https://developer.apple.com/forums/thread/660516">enabled</a> in the “Experimental Features” developer menu in production releases.</p><p>A browser and web server typically automatically negotiate the highest HTTP version available. Thus, HTTP/3 takes precedence over HTTP/2. We looked back over the last year to understand HTTP/3 usage trends across the Cloudflare network, as well as analyzing HTTP versions used by traffic from leading browser families (Google Chrome, Mozilla Firefox, Microsoft Edge, and Apple Safari), major search engine indexing bots, and bots associated with some popular social media platforms. The graphs below are based on aggregate HTTP(S) traffic seen globally by the Cloudflare network, and include requests for website and application content across the Cloudflare customer base between May 7, 2021, and May 7, 2022. We used <a href="https://developers.cloudflare.com/bots/concepts/bot-score/">Cloudflare bot scores</a> to restrict analysis to “likely human” traffic for the browsers, and to “likely automated” and “automated” for the search and social bots.</p>
    <div>
      <h3>Traffic by HTTP version</h3>
      <a href="#traffic-by-http-version">
        
      </a>
    </div>
    <p>Overall, HTTP/2 still comprises the majority of the request traffic for Cloudflare customer content, as clearly seen in the graph below. After remaining fairly consistent through 2021, HTTP/2 request volume increased by approximately 20% heading into 2022. HTTP/1.1 request traffic remained fairly flat over the year, aside from a slight drop in early December. And while HTTP/3 traffic initially trailed HTTP/1.1, it surpassed it in early July, growing steadily and  roughly doubling in twelve months.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2UKNCgWJPAocsCrvTmqKOG/6c1d9ff45b8c4430f4663f4fe8a41964/image13-1.png" />
            
            </figure>
    <div>
      <h3>HTTP/3 traffic by browser</h3>
      <a href="#http-3-traffic-by-browser">
        
      </a>
    </div>
    <p>Digging into just HTTP/3 traffic, the graph below shows the trend in daily aggregate request volume over the last year for HTTP/3 requests made by the surveyed browser families. Google Chrome (orange line) is far and away the leading browser, with request volume far outpacing the others.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6fOBxNVQis3KRP9qMJtN0h/07df569e787dcfd3b918124a9c324b30/image6-21.png" />
            
            </figure><p>Below, we remove Chrome from the graph to allow us to more clearly see the trending across other browsers. Likely because it is also based on the Chromium engine, the trend for Microsoft Edge closely mirrors Chrome. As noted above, Mozilla Firefox first enabled production support in <a href="https://hacks.mozilla.org/2021/04/quic-and-http-3-support-now-in-firefox-nightly-and-beta/">version 88</a> in April 2021, making it available by default by the end of May. The increased adoption of that updated version during the following month is clear in the graph as well, as HTTP/3 request volume from Firefox grew rapidly. HTTP/3 traffic from Apple Safari increased gradually through April, suggesting growth in the number of users enabling the experimental feature or running a Technology Preview version of the browser. However, Safari’s HTTP/3 traffic has subsequently dropped over the last couple of months. We are not aware of any specific reasons for this decline, but our most recent observations indicate HTTP/3 traffic is recovering.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7Mupv6iXQ195JfJkFLJQjX/cb0cc4153c043740e92e93fb2e041626/image2-57.png" />
            
            </figure><p>Looking at the lines in the graph for Chrome, Edge, and Firefox, a weekly cycle is clearly visible in the graph, suggesting greater usage of these browsers during the work week. This same pattern is absent from Safari usage.</p><p>Across the surveyed browsers, Chrome ultimately accounts for approximately 80% of the HTTP/3 requests seen by Cloudflare, as illustrated in the graphs below. Edge is responsible for around another 10%, with Firefox just under 10%, and Safari responsible for the balance.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3Yph7V9e1W31PWkSry6pCy/6c874447bfa49392244e587dfb3d35fe/image1-64.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1zPj3TMsZuiirtoljldJYy/12f92447d2d0b3c26afd0b5754c510f1/image8-10.png" />
            
            </figure><p>We also wanted to look at how the mix of HTTP versions has changed over the last year across each of the leading browsers. Although the percentages vary between browsers, it is interesting to note that the trends are very similar across Chrome, Firefox and Edge. (After Firefox turned on default HTTP/3 support in May 2021, of course.)  These trends are largely customer-driven – that is, they are likely due to changes in Cloudflare customer configurations.</p><p>Most notably we see an increase in HTTP/3 during the last week of September, and a decrease in HTTP/1.1 at the beginning of December. For Safari, the HTTP/1.1 drop in December is also visible, but the HTTP/3 increase in September is not. We expect that over time, once Safari supports HTTP/3 by default that its trends will become more similar to those seen for the other browsers.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4P1m2PJH7GBq9kBUL4vH0/fd19391109337e16a255967b54120392/image7-12.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5Fj8pBr6Z5tpMV9XUTC1lJ/68b10faf3b1f840844d1cf97f8204b64/image9-6.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6iMw3Aj3IXWpjn4LyxBAsG/7b59629b937fb39d352a126a5bd178d3/image12-1.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2dtxJLKq2N23CBwcZlEz8s/64bdc5275320e16bd0b8780db49e0ffc/image11-2.png" />
            
            </figure>
    <div>
      <h3>Traffic by search indexing bot</h3>
      <a href="#traffic-by-search-indexing-bot">
        
      </a>
    </div>
    <p>Back in 2014, Google <a href="https://developers.google.com/search/blog/2014/08/https-as-ranking-signal">announced</a> that it would start to consider HTTPS usage as a ranking signal as it indexed websites. However, it does not appear that Google, or any of the other major search engines, currently consider support for the latest versions of HTTP as a ranking signal. (At least not directly – the performance improvements associated with newer versions of HTTP could theoretically influence rankings.) Given that, we wanted to understand which versions of HTTP the indexing bots themselves were using.</p><p>Despite leading the charge around the development of QUIC, and integrating HTTP/3 support into the Chrome browser early on, it appears that on the indexing/crawling side, Google still has quite a long way to go. The graph below shows that requests from GoogleBot are still predominantly being made over HTTP/1.1, although use of HTTP/2 has grown over the last six months, gradually approaching HTTP/1.1 request volume. (A <a href="https://developers.google.com/search/blog/2020/09/googlebot-will-soon-speak-http2">blog post</a> from Google provides some potential insights into this shift.) Unfortunately, the volume of requests from GoogleBot over HTTP/3 has remained extremely limited over the last year.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3gTr2C26AB8SF6aK0CaiK/9b555a912b3428ad9e15572936bf4fb1/image4-32.png" />
            
            </figure><p>Microsoft’s BingBot also fails to use HTTP/3 when indexing sites, with near-zero request volume. However, in contrast to GoogleBot, BingBot prefers to use HTTP/2, with a wide margin developing in mid-May 2021 and remaining consistent across the rest of the past year.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/444sdNtnh5h0LNsGtUWmuV/b4d3a2f76ec4a5b8fc579371c9f005a2/image10-5.png" />
            
            </figure>
    <div>
      <h3>Traffic by social media bot</h3>
      <a href="#traffic-by-social-media-bot">
        
      </a>
    </div>
    <p>Major social media platforms use custom bots to retrieve metadata for shared content, <a href="https://developers.facebook.com/docs/sharing/bot/">improve language models for speech recognition technology</a>, or otherwise index website content. We also surveyed the HTTP version preferences of the bots deployed by three of the leading social media platforms.</p><p>Although <a href="https://http3check.net/?host=www.facebook.com">Facebook supports HTTP/3</a> on their main website (and presumably their mobile applications as well), their back-end FacebookBot crawler does not appear to support it. Over the last year, on the order of 60% of the requests from FacebookBot have been over HTTP/1.1, with the balance over HTTP/2. Heading into 2022, it appeared that HTTP/1.1 preference was trending lower, with request volume over the 25-year-old protocol dropping from near 80% to just under 50% during the fourth quarter. However, that trend was abruptly reversed, with HTTP/1.1 growing back to over 70% in early February. The reason for the reversal is unclear.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6upA1FtAbR6TWhexL8CkxT/87b3f1d676e1f9189ad5b7dc1d869e4a/image3-44.png" />
            
            </figure><p>Similar to FacebookBot, it appears TwitterBot’s use of HTTP/3 is, unfortunately, pretty much non-existent. However, TwitterBot clearly has a strong and consistent preference for HTTP/2, accounting for 75-80% of its requests, with the balance over HTTP/1.1.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2c9sz97ViywLHaRd4vxCwE/9c981e7c39f8c894957447b4a3337c1a/image14-1.png" />
            
            </figure><p>In contrast, LinkedInBot has, over the last year, been firmly committed to making requests over HTTP/1.1, aside from the apparently brief anomalous usage of HTTP/2 last June. However, in mid-March, it appeared to tentatively start exploring the use of other HTTP versions, with around 5% of requests now being made over HTTP/2, and around 1% over HTTP/3, as seen in the upper right corner of the graph below.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1ozCJpCXILw6ulzIAxDyXn/70f9a1c95d76f4fd1f6f9e70e4d3e270/image5-23.png" />
            
            </figure>
    <div>
      <h3>Conclusion</h3>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>We're happy that HTTP/3 has, at long last, been published as <a href="https://www.rfc-editor.org/rfc/rfc9114.html">RFC 9114</a>. More than that, we're super pleased to see that regardless of the wait, browsers have steadily been enabling support for the protocol by default. This allows end users to seamlessly gain the advantages of HTTP/3 whenever it is available. On Cloudflare's global network, we've seen continued growth in the share of traffic speaking HTTP/3, demonstrating continued interest from customers in enabling it for their sites and services. In contrast, we are disappointed to see bots from the major search and social platforms continuing to rely on aging versions of HTTP. We'd like to build a better understanding of how these platforms chose particular HTTP versions and welcome collaboration in exploring the advantages that HTTP/3, in particular, could provide.</p><p>Current statistics on HTTP/3 and QUIC adoption at a country and autonomous system (ASN) level can be found on <a href="https://radar.cloudflare.com/">Cloudflare Radar</a>.</p><p>Running HTTP/3 and QUIC on the edge for everyone has allowed us to monitor a wide range of aspects related to interoperability and performance across the Internet. Stay tuned for future blog posts that explore some of the technical developments we've been making.</p><p>And this certainly isn't the end of protocol innovation, as HTTP/3 and QUIC provide many exciting new opportunities. The IETF and wider community are already underway building new capabilities on top, such as <a href="/unlocking-quic-proxying-potential/">MASQUE</a> and <a href="https://datatracker.ietf.org/wg/webtrans/documents/">WebTransport</a>. Meanwhile, in the last year, the QUIC Working Group has adopted new work such as <a href="https://datatracker.ietf.org/doc/draft-ietf-quic-v2/">QUIC version 2</a>, and the <a href="https://datatracker.ietf.org/doc/draft-ietf-quic-multipath/">Multipath Extension to QUIC</a>.</p>
    <div>
      <h3>Watch on Cloudflare TV</h3>
      <a href="#watch-on-cloudflare-tv">
        
      </a>
    </div>
    <div></div><p></p> ]]></content:encoded>
            <category><![CDATA[HTTP3]]></category>
            <category><![CDATA[QUIC]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[IETF]]></category>
            <guid isPermaLink="false">4Dd2QedroFWYvUMb5Ba3ha</guid>
            <dc:creator>Lucas Pardue</dc:creator>
            <dc:creator>David Belson</dc:creator>
        </item>
    </channel>
</rss>