
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Sat, 11 Apr 2026 14:17:54 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Banish bots from your Waiting Room and improve wait times for real users]]></title>
            <link>https://blog.cloudflare.com/banish-bots-from-your-waiting-room-and-improve-wait-times-for-real-users/</link>
            <pubDate>Mon, 03 Mar 2025 14:00:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare Waiting Room is improving the user experience through the addition of Turnstile and Session Revocation, keeping wait times low and protecting against bot traffic. ]]></description>
            <content:encoded><![CDATA[ <p>With <a href="https://www.cloudflare.com/application-services/products/waiting-room/?cf_target_id=80139F59125DEFCA9DD4FAF8C6C73D4F"><u>Cloudflare Waiting Room,</u></a> you can safeguard your site from traffic surges by placing visitors in a customizable, virtual queue. Previously, many site visitors waited in the queue alongside bots, only to find themselves competing for inventory once in the application. This competition is inherently unfair, as bots are much faster and more efficient than humans. As a result, humans inevitably lose out in these high-demand situations, unable to secure inventory before bots sweep it all up. This creates a frustrating experience for real customers, who feel powerless against the speed and automation of bots, leading to a diminished experience overall. Those days are over! Today, we are thrilled to announce the launch of two Waiting Room solutions that significantly improve the visitor experience.</p><p>Now, <b>all</b> Waiting Room customers can add an invisible <a href="https://www.cloudflare.com/application-services/products/turnstile/?cf_history_state=%7B%22guid%22%3A%22C255D9FF78CD46CDA4F76812EA68C350%22%2C%22historyId%22%3A21%2C%22targetId%22%3A%222734F402BB1100617F807DE827E8036D%22%7D"><u>Turnstile </u></a>challenge to their queueing page, robustly challenging traffic and gathering analytics on bot activity within their queue. With Advanced Waiting Rooms, you can select between an <a href="https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types"><u>invisible, managed, or non-interactive widget mode</u></a>. But, we won’t just block these bots! Instead, traffic with definite bot signals that have failed the Turnstile challenge can be sent to an Infinite Queue, a completely customizable page that mimics a real user experience. This prolongs the time it takes bots to realize they have not actually joined the queue, wasting their resources without impacting real users. This feature not only protects your site against bots, but also reduces wait times and protects inventory by ensuring the queue only consists of genuine users. To offset the environmental impact of wasting bot resources, we’re contributing to a <a href="https://blog.cloudflare.com/cleaning-up-bad-bots/#planting-trees"><u>tree planting initiative</u></a>, helping to reduce the carbon footprint of inefficient bots. </p><p>The second solution we have launched to improve the visitor experience is Session Revocation, which allows you to end a user’s session based on an action, dynamically opening up spots and admitting users from the queue. This new capability allows you to integrate Waiting Room more seamlessly with your customer journey, resulting in increased throughput, decreased wait times, and increased fairness by giving more users the opportunity to make it through the queue during high demand events. </p><p>This feature has proven to be extremely impactful for our customers, including a large online retailer that frequently has high-demand limited edition product drops. A common challenge in this space is maximizing the number of customers who can make a purchase during a limited-time event, all while maintaining a fair and efficient system for everyone involved. Previously, this customer had to limit their users to only one item in the cart and force them to wait for a period of time after each checkout before allowing them to rejoin the queue. This led to an awkward experience for end users, longer wait times, and reduced site throughput. With session revocation, this online retailer can now end the user’s session immediately after a purchase is complete, placing the user back in the queue if applicable, <b>without </b>being forced to wait for a preset timeout period. This significantly improves the end user experience by reducing unnecessary wait times and streamlining the purchase process.</p><p>Let’s deep dive into these two capabilities and how they improve the overall user experience.</p>
    <div>
      <h3>How bots impact the Waiting Room user experience </h3>
      <a href="#how-bots-impact-the-waiting-room-user-experience">
        
      </a>
    </div>
    <p>Waiting Room is often used to protect sites from being overwhelmed by traffic surges during high demand online events. These high demand events, such as ticket or e-commerce product sales, attract both a deluge of genuine users, and sophisticated bots, such as scalper bots. This type of bot traffic is unique, as they can complete the checkout process or user journey much quicker than normal human traffic. Bots in the queue negatively affect the user experience by increasing wait times, as they often occupy multiple spots. Additionally, their behavior can exacerbate the issue — if they don't handle cookies properly, they fail to take their spot in the application when their turn comes, further preventing the queue from progressing smoothly. Once past the queue, bots can also contribute to inventory hoarding, as they often reserve or consume large quantities of stock without genuine intent to purchase. An <a href="https://www.nbcnews.com/tech/video-games/good-luck-finding-playstation-5-walmart-retailers-battle-fast-buying-b-rcna193"><u>example</u></a> of this is the PlayStation 5’s launch in November 2020. Due to high demand and production limitations during the COVID-19 pandemic, scalper bots bought up stock quickly, making it difficult for average consumers to purchase the console at retail prices. This led to extreme frustration for retailers and consumers as these bots drove the prices up significantly. </p>
    <div>
      <h3>Quantifying bot traffic to Waiting Room with an invisible Turnstile challenge</h3>
      <a href="#quantifying-bot-traffic-to-waiting-room-with-an-invisible-turnstile-challenge">
        
      </a>
    </div>
    <p>Waiting Room customers have long been curious about the nature of large traffic spikes. Historically, <a href="https://developers.cloudflare.com/bots/concepts/bot-score/"><u>bot scores</u></a> and <a href="https://developers.cloudflare.com/waf/reference/cloudflare-challenges/"><u>managed challenges</u></a> have been the primary methods of collecting this data and acting on it. While these can provide some insight into the distribution of traffic, the Turnstile invisible challenge gives us the ability to actively interrogate the browser, providing the most complete set of data on whether that browser is being operated by a human or a bot. </p><p>To start quantifying bot traffic to waiting rooms, we have added an invisible Turnstile challenge to all basic rooms. With the purchase of an Advanced Waiting Room, customers can select between invisible, managed, or non-interactive widget modes. This Turnstile team <a href="https://blog.cloudflare.com/guide-to-cloudflare-pages-and-turnstile-plugin/?_gl=1*1fb6wb0*_gcl_au*Mzg4NDc3ODA1LjE3MzY3ODc4NjI.*_ga*MTI5NDczNzY0Ny4xNzM0NzEyNjMx*_ga_SQCRB0TXZW*MTczODYwNDE5Ny4xNC4xLjE3Mzg2MDQ4MDIuMjUuMC4w/#step-2-embed-turnstile-widget"><u>blog post</u></a> has more details on the different widget modes.  </p><p>Waiting Room’s integration with Turnstile aims to protect your site with minimal impact to the user experience by placing a Turnstile challenge on your waiting room’s queuing page. Unlike a standard WAF challenge, the Waiting Room Turnstile challenge is presented only when the waiting room is queuing. This way, users won’t face any interruptions once they are past the queue and into the application. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3GLXMvDBi5jBTs9rxQXBin/e75077558061fd5afe0a0244d807814c/image8.png" />
          </figure><p><sup><i>With an advanced waiting room, you can configure the type of Turnstile challenge from the Cloudflare dashboard and API.</i></sup></p><p>From the analytics we’ve gathered with the invisible Turnstile challenge on all basic waiting rooms, we’ve been able to determine that many large traffic spikes come from user agents that don’t even attempt to run the challenge, leaving it unsolved. In other words, we send the challenge widget in the HTML for the queuing page, but sometimes those challenges never get completed. By subtracting the number of times we see solved challenges from the total number of times we send challenges, we can get a count of requests that are likely from unsophisticated bots. These requests are reported to Waiting Room Analytics as “Likely Bots.” We’ve seen small businesses with low baseline traffic hit with tens of thousands of such requests (or more) in a short period of time. When a large influx of non-human traffic like this comes in, every visitor to the website ends up queued in a waiting room, not just the bots.</p><p>These bots could be any software that simply sends out HTTP requests. This data can help determine whether a traffic spike and subsequent queueing is coming from real human users, or a bunch of simple bots that don’t even bother to run JavaScript.</p><p>With the Turnstile integration, we are also catching sophisticated bots. While many of the bots we see don’t attempt to run the challenge, there are a few that do. Detecting these bots is more difficult than detecting simple bots that don’t run JavaScript. The Turnstile widget runs a series of checks against the browser to find evidence that a browser isn’t being operated by a human, and is instead being driven by something like <a href="https://www.selenium.dev/"><u>Selenium</u></a>. If Turnstile isn’t able to determine that the browser is being operated by a human, we count that as a failed challenge and report those users to Waiting Room Analytics as “Bots,” since we are quite confident that these users are not human.</p><p>About 1 in 20 “users” that run the challenge end up not passing. Just like the previously mentioned unsophisticated bots, these more sophisticated bots inflate the size of the queue, making it more difficult for real humans to make it through to your website.</p><p>The remaining 19 in 20 “users” that successfully pass the challenge are counted in Waiting Room Analytics as “Likely Humans.”</p><p>These new metrics related to Turnstile challenge outcomes are available in your Waiting Room Analytics dashboard and the <a href="https://developers.cloudflare.com/analytics/graphql-api/"><u>analytics GraphQL API</u></a>, so you can see the distribution of bot to human traffic in your waiting room. Once you know what your traffic looks like, the real question is: what can you do about it?</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1RVNiQAX4OE87L0H7ByyWb/b6eadb0f348d7ce711d138862b778117/image2.png" />
          </figure><p><sup><i>View the distribution of traffic and challenges issued in Waiting Room Analytics</i></sup></p>
    <div>
      <h3>New Infinite Queue feature</h3>
      <a href="#new-infinite-queue-feature">
        
      </a>
    </div>
    <p>Beyond logging your Turnstile challenge outcomes, Advanced Waiting Room customers have the option to select the Infinite Queue feature. With this feature, all traffic that fails the Turnstile challenge, such as a bot, will be sent to an Infinite Queue page. The Infinite Queue matches the normal queuing experience, prolonging the time it takes the bot to recognize they are being blocked and effectively consuming their resources. While the Infinite Queue will have the same look and feel as the Waiting Room page, the bot is not actually a part of the real queue. </p><p>With the infinite Queue enabled, all traffic will have to pass the challenge to enter the real queue. By blocking bots from joining the queue, we will reduce wait times for humans and prevent bots from using up server resources during a traffic spike.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/55Du8cmC3JfX4FrhL9KWIM/b273bb820290aad6997494551c0b49ac/image9.png" />
          </figure><p><sup><i>Enable the Infinite Queue option through the Cloudflare dashboard or API.</i></sup></p><p>Bots will be none the wiser, wasting their time and resources waiting in an infinite queue that will never get them to where they’re trying to go.</p><p>We keep track of the traffic hitting the infinite queue, counting the number of times they refresh their queuing page in Waiting Room Analytics. This appears as the “infinite queue refreshes” count in the analytics dash and GraphQL API. This metric gives you a good idea of the amount of time these bots have wasted trying to reach your website.</p>
    <div>
      <h3>How Waiting Room integrates with Turnstile</h3>
      <a href="#how-waiting-room-integrates-with-turnstile">
        
      </a>
    </div>
    <p>Turnstile is a powerful and versatile product that anyone, Cloudflare and others alike, can use to build systems to thwart bot traffic. Waiting Room integrates Turnstile the same as any other Turnstile user.</p>
            <pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;Waiting Room&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;h1&gt;You are currently in the queue.&lt;/h1&gt;
		{{#waitTimeKnown}}
			&lt;h2&gt;Your estimated wait time is {{waitTimeFormatted}}.&lt;/h2&gt;
		{{/waitTimeKnown}}
		{{^waitTimeKnown}}
			&lt;h2&gt;Your estimated wait time is unknown.&lt;/h2&gt;
		{{/waitTimeKnown}}
		{{#turnstile}}
			&lt;!-- for a managed (and potentially interactive) challenge, you may want to instruct the user to complete the challenge --&gt;
			&lt;p&gt;Please complete this challenge so we know you're a human:&lt;/p&gt;
			{{{turnstile}}} &lt;!-- include the turnstile widget --&gt;
		{{/turnstile}}
	&lt;/body&gt;
&lt;/html&gt;</code></pre>
            <p><sup><i>The Turnstile widget can be embedded in custom queuing page templates by including the </i></sup><code><sup><i>{{{turnstile}}}</i></sup></code><sup><i> variable.</i></sup></p>
            <pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;Waiting Room&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
		{{#turnstile}}
			&lt;h1&gt;This website is currently using a waiting room.&lt;/h1&gt;
			&lt;p&gt;We use a Turnstile challenge to ensure you aren't waiting in line behind bots. Complete this challenge to enter the queue.&lt;/p&gt;
			{{{turnstile}}} &lt;!-- include the turnstile widget --&gt;
		{{/turnstile}}
		{{^turnstile}}
			&lt;h1&gt;You are currently in the queue.&lt;/h1&gt;
			{{#waitTimeKnown}}
				&lt;h2&gt;Your estimated wait time is {{waitTimeFormatted}}.&lt;/h2&gt;
			{{/waitTimeKnown}}
			{{^waitTimeKnown}}
				&lt;h2&gt;Your estimated wait time is unknown.&lt;/h2&gt;
			{{/waitTimeKnown}}
		{{/turnstile}}
	&lt;/body&gt;
&lt;/html&gt;</code></pre>
            <p><sup><i>When using Infinite Queue (especially with managed challenges which may be interactive), you may want to tell users they will not be in the queue until they complete the challenge.</i></sup></p><p>We embed a plain Turnstile challenge in the queuing page by passing the HTML to the queuing page template in a <code>turnstile</code> variable. The default queuing page template and any newly created custom templates include this variable already. If you have an existing custom HTML template and wish to enable the Turnstile integration, you will need to add <code>{{{turnstile}}}</code> somewhere in the template to tell Waiting Room where the widget should be placed. Waiting Room uses <a href="https://mustache.github.io/"><u>Mustache</u></a> templates, so including raw HTML within your template without escaping requires three curly braces instead of two.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1SLLpx14dpaGITEsSxgDqX/eecd16a85e531de0b5325df5535e8ae8/image1.png" />
          </figure><p><sup><i>A managed Turnstile challenge on the default Waiting Room queuing page template</i></sup></p><p>Once the challenge completes, fails, or times out, the page refreshes and passes the Turnstile token to <a href="https://blog.cloudflare.com/building-waiting-room-on-workers-and-durable-objects/"><u>Waiting Room’s worker</u></a>. Next, we check in with <a href="https://developers.cloudflare.com/turnstile/get-started/server-side-validation/"><u>Turnstile’s siteverify endpoint</u></a> to make sure the challenge was successful. From there, we report the outcome to the Waiting Room’s analytics and optionally send failed traffic (bots) to an infinite queue.</p><p>The infinite queue itself is designed to be as close to normal queuing as possible. When a bot is sent to the infinite queue, we issue it a cookie which looks like a normal waiting room cookie. Inside the cookie’s encryption though, we have a boolean flag that tells our worker to send the bot’s requests to the infinite queue. When we see that flag, we skip all the normal queuing logic and just render a queuing page.</p><p>That queuing page shows a fake estimated time remaining. It’s based on an asymptotic curve which appears to decrease linearly from the start. As time goes on, the curve gets flatter (and progress through the “queue” gets slower), so the estimated time remaining never quite reaches 0.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1J2U58CHRruMQ5LTkRo0fQ/8e7116eae5ba9fdecc6ac6cf404984ea/image5.png" />
          </figure><p><sup><i>This graph is an approximation of the time remaining (y-axis, minutes) that bots will see, compared to the amount of time they’ve waited in the infinite queue (x-axis, minutes).</i></sup></p><p>We reuse much of the same code for rendering the queuing page for the infinite queue and the normal queue. We do this to reduce the amount of signal bots may have that they are in the infinite queue rather than the normal queue.</p>
            <pre><code>let cookie
if (query['cf_wr_turnstile']) {
    const turnstileToken = query['cf_wr_turnstile']
    const tokenOk = await siteverify(turnstileToken)
    if (tokenOk) {
        analytics.turnstileSuccesses++
        cookie = newCookie()
    } else {
        analytics.turnstileFailures++
        cookie = { infiniteQueuing: true }
    }
    response.headers['Set-Cookie'] = encryptCookie(cookie)
}
if (!cookie) {
    cookie = decryptCookie(headers['Cookie'])
}
if (!cookie) {
    analytics.turnstileChallenges++
    return await queuingPage(await estimateTimeRemaining(), { turnstileChallenge: true })
} else if (cookie.infiniteQueuing) {
    analytics.infiniteQueueRequests++
    return await queuingPage(fakeTimeRemaining())
} else if (cookie.accepted) {
    return await sendToOrigin()
} else {
    // run Waiting Room's distributed queuing logic to check whether
    // this user has made it to the front of the queue, but only after
    // the user has completed a Turnstile challenge and isn't in the
    // fake infinite queue
    const { letThrough, timeRemaining } = calculateQueuing(cookie)
    if (letThrough) {
        cookie.accepted = true
        response.headers['Set-Cookie'] = encryptCookie(cookie)
        return await sendToOrigin()
    } else {
        return await queuingPage(timeRemaining)
    }
}</code></pre>
            <p><sup><i>Approximate psuedocode for how we handle incoming requests when infinite queue is enabled in the Waiting Room worker</i></sup></p><p>Thanks to the versatility of Turnstile, we only needed to rely on public Turnstile APIs to build this integration.</p><p>Adding Turnstile to Waiting Room is a proactive step in managing traffic that directly contributes to a smoother, faster experience for end users. Building on that efficiency, let’s dive into how you can add an additional layer of control to increase throughput and minimize wait times for your customers.</p>
    <div>
      <h3>Further improve wait times using session revocation</h3>
      <a href="#further-improve-wait-times-using-session-revocation">
        
      </a>
    </div>
    <p>We have talked extensively in a previous <a href="https://blog.cloudflare.com/building-waiting-room-on-workers-and-durable-objects/#how-does-the-waiting-room-work"><u>blog post</u></a> about how we queue users with respect to the current active users on the application and the defined limits, and, in the same <a href="https://blog.cloudflare.com/building-waiting-room-on-workers-and-durable-objects/#waiting-room-state"><u>blog post</u></a>, what state and calculations we use to determine the amount of total active users. Here is a quick summary for those who have not read that post:</p><p>When a user navigates to a page behind a waiting room, they receive a <a href="https://developers.cloudflare.com/waiting-room/reference/waiting-room-cookie/"><u>cookie</u></a> and are associated with a time period called a bucket. We use these buckets to track the number of users either waiting in the queue or accessing the application for that specific time period. Whenever a user makes a request, we move their session from their previous bucket to the latest bucket. Once a bucket is older than the configured session duration, we know that those user sessions are no longer valid (expired) and we can clean up those values. Thus, that user session expires, and new slots are opened for the next users to enter the application.</p><p>These buckets are aggregated at Cloudflare data centers and then globally via the internal state of the waiting room, which is structured as multiple <a href="https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type"><u>CRDT</u></a> counters and registers. This allows us to merge the distributed state of the waiting room stored in multiple data centers as a single global state without conflicts.</p><p>To calculate the total active users on an application, we first merge the state from all data centers. Then, we sum the active users for all the buckets where a session can still be active.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/47yTgIvnWdYEcoOSoGPO8E/2989c82fcecd31ec22eb1384b0ff9e15/image7.png" />
          </figure><p>Because the Waiting Room runs per user request, we do not explicitly know when a user has stopped accessing the application, and instead we only stop receiving requests from them. So, we must consider their session active and as a contributor to the total active users count until it is older than the session duration limit. For waiting rooms that have a high session duration value configured, a user might navigate to the site for a small duration of time but contribute to the total active users count for up to the configured session duration even after they have stopped accessing the application. This can cause decreased throughput and longer wait times for users in the queue. </p>
    <div>
      <h3>Introducing Session Revocation </h3>
      <a href="#introducing-session-revocation">
        
      </a>
    </div>
    <p>With the Session Revocation feature, we now allow origins to return a command to the waiting room via an HTTP header (<code>Cf-Waiting-Room-Command</code>) to notify the Waiting Room to revoke the user session associated with the current response. This command removes the current user’s session and decreases the number of total active users for the bucket the session was last tracked in. This allows origins to terminate a user’s session early without needing to wait for the session to expire naturally.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2THxw5YatXjjZ4GxTP793n/0536e1d0eb3166c94ccfb6c7dce4148a/image4.png" />
          </figure><p>This can improve the throughput of waiting rooms in front of applications which have a dynamic user flow where the session duration is set very high to account for users who send infrequent requests to the application.</p><p>To set up session revocation in your waiting room, in the user session settings section in the configuration, check the “Allow session termination via origin commands” box. You must also configure your origin to return a session revocation HTTP header (<code>Cf-Waiting-Room-Command: revoke</code>) on the response when you want the session associated with that response to be revoked. For more information on how to do this, refer to our <a href="https://developers.cloudflare.com/waiting-room/how-to/control-user-session/#revoke-a-users-session-using-origin-commands"><u>developer documentation</u></a>. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4XXqREJAf1FwrDAFSUovJs/53cb8bd410647046b05ad6b8b6f9f277/image6.png" />
          </figure><p><sup><i>Enable session revocation in the user session settings configuration</i></sup></p><p>In Waiting Room Analytics, you can view the number of sessions revoked per minute. The <code>sessionsRevoked</code><b> </b>field is the count of how many sessions were revoked in that minute in the <a href="https://developers.cloudflare.com/analytics/graphql-api/"><u>analytics GraphQL API</u></a>.  </p><p>In summary, Waiting Room Turnstile Integration and Session Revocation work together to enhance both security and user experience. The addition of a Turnstile challenge in the Waiting Room helps identify and block bots, ensuring that legitimate users don’t face unnecessary delays. Meanwhile, the Session Revocation feature optimizes resource usage by allowing you to end user sessions after key actions, like completing a purchase, freeing up space for other users. </p><p>Together, these features successfully increase throughput and reduce wait times, providing a faster, more efficient experience for your customers. For more information on these features, <a href="https://developers.cloudflare.com/waiting-room"><u>check out our developer documentation</u></a>. </p> ]]></content:encoded>
            <category><![CDATA[Waiting Room]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Application Services]]></category>
            <guid isPermaLink="false">48d5TNR7SLaks6NJ9LGb77</guid>
            <dc:creator>Rachel Wyatt </dc:creator>
            <dc:creator>Piper McCorkle</dc:creator>
            <dc:creator>Brad Swenson</dc:creator>
        </item>
        <item>
            <title><![CDATA[Introducing Waiting Room Bypass Rules]]></title>
            <link>https://blog.cloudflare.com/waiting-room-bypass-rules/</link>
            <pubDate>Thu, 19 Jan 2023 14:00:00 GMT</pubDate>
            <description><![CDATA[ Waiting Room now offers customers more fine-tuned control over what traffic a waiting room covers. Queue only the traffic you want to with Bypass Waiting Room Rules, now available to all Enterprise customers with an Advanced Purchase of Waiting Room. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Leveraging the power and versatility of Cloudflare's Ruleset Engine, Waiting Room now offers customers more fine-tuned control over their waiting room traffic. Queue only the traffic you want to with Waiting Room Bypass Rules, now available to all Enterprise customers with an Advanced Purchase of Waiting Room.</p><p>Customers depend on <a href="/cloudflare-waiting-room/">Waiting Room</a> for always-on protection from unexpected and overwhelming traffic surges that would otherwise bring their site down. Waiting Room places excess users in a fully customizable virtual waiting room, admitting new visitors dynamically as spots become available on a customer’s site. Instead of throwing error pages or delivering poorly-performing site pages, Waiting Room empowers customers to take control of their end-user experience during unmanageable traffic surges.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6n3SXyNyJTLfNHzKSadZEQ/500878a533c197451d1afc42e6a1beb9/image7-2.png" />
            
            </figure><p>Take control of your customer experience with a fully customizable virtual waiting room</p><p>Additionally, customers use <a href="/waiting-room-event-scheduling/">Waiting Room Event Scheduling</a> to manage user flow and ensure reliable site performance before, during, and after online events such as product restocks, seasonal sales, and ticket sales. With Event Scheduling, customers schedule changes to their waiting rooms' settings and custom queuing page ahead of time, with options to pre-queue early arrivers and offload event traffic from their origins after the event has concluded.</p><p>As part of the simple, no-coding-necessary process for deploying a waiting room, customers specify a hostname and path combination, which defines <a href="https://developers.cloudflare.com/waiting-room/get-started/#location">the location</a> of their waiting room on their site. When a site visitor makes a preliminary request to that hostname and path or any of its subpaths, they will be issued a waiting room cookie and placed in the queue if the waiting room is queuing at that time.</p><p>The hostname and path approach to defining the placement of a waiting room is intuitive and makes it easy to deploy a waiting room to a site. But, many customers needed more granular control over what traffic and parts of their site their waiting room did or did not cover under a waiting room’s configured hostname and path. Use cases for allowing specific traffic to bypass a waiting room were varied.</p><p>Examples included allowing internal administrators site access at all times, never blocking internal user agents performing operations like synthetic monitoring, not applying waiting room to specific subpaths or query strings, or queuing only traffic from certain countries. Given the diversity of our customers’ requests to exclude traffic from a waiting room’s coverage, we built a bypass feature that gave customers the versatility necessary to deploy waiting rooms aligned with their existing site architecture and use cases. With the release of Event Scheduling, Waiting Room customers could queue <i>when</i> they wanted to; now, we are excited to announce that customers now have more flexibility to queue <i>who</i> and <i>where</i> they want to with Waiting Room Bypass Rules.</p>
    <div>
      <h2>Who gets queued is up to you</h2>
      <a href="#who-gets-queued-is-up-to-you">
        
      </a>
    </div>
    <p>Waiting Room Bypass Rules allow customers to write expressions that define what traffic should bypass their waiting room. A waiting room will not apply to incoming requests matching conditions based on one or more <a href="https://developers.cloudflare.com/waiting-room/additional-options/waiting-room-rules/bypass-rules/">available fields</a>, like IP address, URI path, query string, and country. Bypass rules supersede all Waiting Room features; even in <a href="https://developers.cloudflare.com/waiting-room/how-to/control-waiting-room/#queue-all-visitors">Queue-all mode</a>, event pre-queuing, or any other waiting room state, traffic matching your enabled rules’ expressions will never be queued or issued a waiting room cookie. Waiting Room rules are created via the Waiting Room API or the Waiting Room dashboard using a familiar rule management interface found throughout the Cloudflare dashboard. Waiting Room rules are managed at the individual waiting room level for precise control over each waiting room’s traffic.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2qU9yyQgWm9n7sohikI5LL/a9415c27aac27e2dd617df2876a75250/Screen-Shot-2022-11-28-at-11.35.50-AM.png" />
            
            </figure><p>Use the familiar rule builder found throughout the Cloudflare dashboard to define which traffic should bypass your waiting room.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/732mVjGlMIDtW3rOOhglfK/417683285c722cca7fd1d3538d443ccc/Screen-Shot-2022-11-28-at-12.20.02-PM.png" />
            
            </figure><p>Manage bypass rules at the individual waiting room level for precise control over each waiting room’s traffic coverage.</p>
    <div>
      <h2>Built with the Ruleset Engine</h2>
      <a href="#built-with-the-ruleset-engine">
        
      </a>
    </div>
    <p>We love building Cloudflare products on top of Cloudflare products; we knew that the versatility we wanted to offer to our customers with regard to what traffic a waiting room should apply to would best be achieved by integrating with Cloudflare’s powerful <a href="https://developers.cloudflare.com/ruleset-engine/">Ruleset Engine</a>. The Ruleset Engine provides the infrastructure for many of our highly customizable products, such as the new <a href="https://developers.cloudflare.com/rules/origin-rules/">Origin Rules</a> feature and our <a href="https://developers.cloudflare.com/waf/managed-rulesets/">WAF Managed Rulesets</a>, by providing a unified way to represent the concept of “rules” and an easy-to-integrate software library for consistently executing those rules. This allows all sorts of Cloudflare products to provide extremely similar rules capabilities, with the same language for defining conditions (which can grow quite complex!) and very similar APIs.</p><p>We’ve even found that some of Waiting Room’s product functionality can be best implemented on top of the Ruleset Engine; earlier this year we migrated some select core Waiting Room logic into the Ruleset Engine, implemented as rulesets that we now transparently deploy to every zone with a waiting room. This newly migrated implementation has been running for months, and the flexibility of the Ruleset Engine will make certain future Waiting Room features easier than ever to build.</p><p>The Ruleset Engine works on two major concepts: rulesets and rules. A ruleset is a list of rules that the engine executes in order. A rule consists of a condition and an action, with the action being executed if the condition evaluates to “true”.</p><p>Under the hood, when you create the first rule for a waiting room, we create a hidden ruleset attached to that waiting room. We put together a ruleset of our own which runs on every request to your zone, dispatching to your custom ruleset if a request matches the attached waiting room. This all sounds somewhat complicated, but don’t worry. You simply manage rules at the individual waiting room level, while we abstract away the complexity of the underlying rulesets.</p><p>The Waiting Room Bypass action’s core implementation is quite simple: when the condition on one of your bypass rules is true for a request, the bypass action simply clears the flag on the request that would have told the waiting room code to kick in. This way, the bypass action ensures that Waiting Room doesn’t touch your request and the request doesn’t affect your waiting room’s statistics or queuing.</p>
    <div>
      <h2>Bypass rules in action</h2>
      <a href="#bypass-rules-in-action">
        
      </a>
    </div>
    <p>Creating a bypass rule is easy and requires no coding or application changes. Let's walk through a couple of real-world scenarios to demonstrate how easy it is to deploy a bypass rule from the Waiting Room dashboard or API.</p>
    <div>
      <h3>Set up an Administrative IP Bypass Rule via the Waiting Room Dashboard</h3>
      <a href="#set-up-an-administrative-ip-bypass-rule-via-the-waiting-room-dashboard">
        
      </a>
    </div>
    <p>As mentioned before, many customers wanted to ensure that their site administrators and other internal employees–which they identify by IP address–could access their site at all times, regardless of a waiting room's queueing status. Allowing unrestricted access to specific internal employees is especially important before online events when customers pre-queue early site visitors ahead of an event's start time. Without the ability to bypass the waiting room before the event starts, internal employees could not review their event pages in a production environment, adding friction and uncertainty to their review process. Let's see how we can fix that with a Waiting Room bypass rule.</p><p>Before setting up your administrator bypass rule, you can <a href="https://developers.cloudflare.com/firewall/cf-dashboard/rules-lists/manage-items/">create an IP</a> list if you have more than a handful of IPs you'd like to bypass your waiting room. Then, you will need to <a href="https://developers.cloudflare.com/waiting-room/how-to/create-waiting-room/">configure a waiting room</a> from the Waiting Room dashboard. From that waiting room's expanded view, navigate to Manage rules, where you can create, disable, and delete rules for a waiting room.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7nLXLofqRK0U1S8hhCwpBB/d3f9e719e190a59833947020bc20e584/Untitled-3.png" />
            
            </figure><p>Once you have created your waiting room, from that waiting room’s expanded view, select Manage rules to create Waiting Room bypass rules.</p><p>Using the rule builder, give your rule a descriptive name and build your expression. To build an expression for this example, we will select “IP Source Address” from the Field drop-down, “is in list” from the Operator drop-down, and then select the name of the IP list we created earlier.  Once we've built the expression, we can either save this rule as a draft and deploy it later or save the rule and deploy it now.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7GVmQpVKb3VixCNl5cJMiJ/661656758a8964c5d7b6533e1cc02317/Untitled--1--2.png" />
            
            </figure><p>Allow site administrators to bypass your waiting room by creating a Waiting Room bypass rule via the Waiting Room dashboard.</p><p>Once saved, the rule will appear on this waiting room's rules management page along with all other rules for this waiting room. All requests for which this rule's expression evaluates to true will bypass the waiting room. Thus, any user with an IP address from this managed list will never be queued when this rule is enabled.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3Nhijav5NcNydJBITXNrC5/b0ab6e47d6bfa28a419888f5759a9e49/Untitled--2-.png" />
            
            </figure><p>Enable or disabled Waiting Room rules from an individual waiting room’s rule management dashboard.</p><p>For added oversight, there are indicators on the Waiting Room dashboard that clearly signal if a waiting room has any bypass rules enabled. Now that we have deployed the admin bypass rule, we can see from the Waiting Room table that there is an active rule for this waiting room.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4JhsSbz8HTYPiNyvHk6vSo/9f347fbe55a1a99e28582ede188147ec/Screenshot-2022-12-09-at-9.51.26-AM.png" />
            
            </figure><p>Easily glean which waiting rooms have bypass rules active from the Waiting Room table.</p>
    <div>
      <h2>Bypass rules via the Waiting Room API - path bypass example</h2>
      <a href="#bypass-rules-via-the-waiting-room-api-path-bypass-example">
        
      </a>
    </div>
    <p>Another common customer request now achievable using Waiting Room Bypass Rules is path exclusions. As mentioned previously, a waiting room applies to all requests hitting the hostname and path combination of the configured waiting room and any URLs under that path. For many Waiting Room customers, there were specific URLs, paths, or query strings that they did not want a waiting room to apply to under their configured hostname and path. There are various reasons why a customer would want to make exceptions like this but let's consider the following use case to illustrate the utility of bypassing specific parts of a site or application.</p><p>Consider a movie ticketing platform that wants to protect its ticketing web application from purchasing surges due to blockbuster releases. They create a waiting room to cover their ticketing web app by placing it at ticketing.example.com/. After tickets are purchased, the ticketing platform sends movie-goers an email or a text which links back to a URL under ticketing.example.com/. The URL the user receives via text or email is: ticketing.example.com/myaccount/mobiletickets/userverified?ticketid=</p><p>This link opens a page in the user’s mobile browser containing a QR code that the movie theater will scan in place of a physical ticket. They want to ensure that the waiting room does not apply to customers trying to open their mobile tickets.</p><p>To do this, they would create the following bypass rule via the Waiting Room API as follows:</p><p>With a <a href="https://developers.cloudflare.com/waiting-room/how-to/create-waiting-room/#create-a-waiting-room-via-the-api">waiting room already configured</a> at ticketing.example.com/, use the following API call to create a bypass rule:</p>
            <pre><code>curl -X POST \"https://api.cloudflare.com/client/v4/zones/&lt;ZONE_ID&gt;/waiting_rooms/&lt;ROOM_ID&gt;/rules" \-H "Authorization: Bearer &lt;API_TOKEN&gt;" \
-d '{    
"description": "ticket holders bypass waiting room",    
"expression": "ends_with(http.request.uri.path, \"/userverified\")  
 "action": "bypass_waiting_room"
}'</code></pre>
            <p>Let’s break down this call. First, there is the URL, which needs to be populated with the zone id and the waiting room id. Then we pass our API token in the Authorization header. This call will create a new Waiting Room rule that will be added after any existing rules for this waiting room.</p><p>Within the body of the call, first define an optional description parameter. Give the rule an optional <code>description</code> to indicate the purpose of the rule for easy reference later.</p><p><code>"description": "ticket holders bypass waiting room"</code></p><p>Next, write the expression, which defines the exact traffic which should bypass the waiting room. In this example, customers using the direct link sent via text should bypass the waiting room. These direct links end with the path <code>userverified</code> so create an <code>ends_with</code> condition.</p><p><code>"expression": "ends_with(http.request.uri.path, \"/userverified\")</code></p><p>When creating a bypass rule for path, query string, or URLs, make sure to include in the expression exclusions for <a href="https://developers.cloudflare.com/waiting-room/additional-options/waiting-room-rules/bypass-rules/#a-note-on-subrequests">subrequests that load assets</a> on the pages covered by a waiting room. Let’s assume in this example we are hosting assets on a different subdomain not covered by the waiting room. Therefore, we do not need to include these subrequests in the expression.</p><p>Lastly, set the action parameter to <code>bypass_waiting_room</code> to indicate that this traffic should bypass the waiting room and deploy the rule. This customer's waiting room now covers precisely the parts of their application they want to cover. Their waiting room will protect their web application from ticket purchasing traffic while ensuring that customers who need to display their mobile tickets at the movie theater can do so reliably without being placed in a Waiting Room queue.</p><p>With the addition of Waiting Room Bypass Rules, customers now have more flexibility to deploy waiting rooms on their terms, to cover exactly the traffic they want. For more on Waiting Room Bypass Rules and Waiting Room, <a href="https://developers.cloudflare.com/waiting-room/additional-options/waiting-room-rules/bypass-rules/">check out our developer documentation</a>.</p><p>Not using Cloudflare yet? Start now with our <a href="https://www.cloudflare.com/plans/business/">Business plan</a> which includes one basic Waiting Room or <a href="https://www.cloudflare.com/plans/enterprise/discover/contact/">contact us</a> about our advanced Waiting Room with Event Scheduling, Customized Templates, and Waiting Room Bypass Rules available on our <a href="https://www.cloudflare.com/plans/enterprise/">Enterprise plan</a>.</p> ]]></content:encoded>
            <category><![CDATA[Waiting Room]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Application Services]]></category>
            <guid isPermaLink="false">5WrPFRu8C4Q6DQPN7d9rOW</guid>
            <dc:creator>Arielle Olache</dc:creator>
            <dc:creator>Piper McCorkle</dc:creator>
        </item>
    </channel>
</rss>