
<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>Mon, 06 Apr 2026 01:41:16 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Astro is joining Cloudflare]]></title>
            <link>https://blog.cloudflare.com/astro-joins-cloudflare/</link>
            <pubDate>Fri, 16 Jan 2026 14:00:00 GMT</pubDate>
            <description><![CDATA[ The Astro Technology Company team — the creators of the Astro web framework — is joining Cloudflare. We’re doubling down on making Astro the best framework for content-driven websites, today and in the years to come. ]]></description>
            <content:encoded><![CDATA[ <p>The Astro Technology Company, creators of the Astro web framework, is joining Cloudflare.</p><p><a href="https://astro.build/"><u>Astro</u></a> is the web framework for building fast, content-driven websites. Over the past few years, we’ve seen an incredibly diverse range of developers and companies use Astro to build for the web. This ranges from established brands like Porsche and IKEA, to fast-growing AI companies like Opencode and OpenAI. Platforms that are built on Cloudflare, like <a href="https://webflow.com/feature/cloud"><u>Webflow Cloud</u></a> and <a href="https://vibe.wix.com/"><u>Wix Vibe</u></a>, have chosen Astro to power the websites their customers build and deploy to their own platforms. At Cloudflare, we use Astro, too — for our <a href="https://developers.cloudflare.com/"><u>developer docs</u></a>, <a href="https://workers.cloudflare.com/"><u>website</u></a>, <a href="https://sandbox.cloudflare.com/"><u>landing pages</u></a>, <a href="https://blog.cloudflare.com/"><u>blog</u></a>, and more. Astro is used almost everywhere there is content on the Internet. </p><p>By joining forces with the Astro team, we are doubling down on making Astro the best framework for content-driven websites for many years to come. The best version of Astro — <a href="https://github.com/withastro/astro/milestone/37"><u>Astro 6</u></a> —  is just around the corner, bringing a redesigned development server powered by Vite. The first public beta release of Astro 6 is <a href="https://github.com/withastro/astro/releases/tag/astro%406.0.0-beta.0"><u>now available</u></a>, with GA coming in the weeks ahead.</p><p>We are excited to share this news and even more thrilled for what it means for developers building with Astro. If you haven’t yet tried Astro — give it a spin and run <a href="https://docs.astro.build/en/getting-started/"><u>npm create astro@latest</u></a>.</p>
    <div>
      <h3>What this means for Astro</h3>
      <a href="#what-this-means-for-astro">
        
      </a>
    </div>
    <p>Astro will remain open source, MIT-licensed, and open to contributions, with a public roadmap and open governance. All full-time employees of The Astro Technology Company are now employees of Cloudflare, and will continue to work on Astro. We’re committed to Astro’s long-term success and eager to keep building.</p><p>Astro wouldn’t be what it is today without an incredibly strong community of open-source contributors. Cloudflare is also committed to continuing to support open-source contributions, via the <a href="https://astro.build/blog/astro-ecosystem-fund-update/"><u>Astro Ecosystem Fund</u></a>, alongside industry partners including Webflow, Netlify, Wix, Sentry, Stainless and many more.</p><p>From day one, Astro has been a bet on the web and portability: Astro is built to run anywhere, across clouds and platforms. Nothing changes about that. You can deploy Astro to any platform or cloud, and we’re committed to supporting Astro developers everywhere.</p>
    <div>
      <h3>There are many web frameworks out there — so why are developers choosing Astro?</h3>
      <a href="#there-are-many-web-frameworks-out-there-so-why-are-developers-choosing-astro">
        
      </a>
    </div>
    <p>Astro has been growing rapidly:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6SiPDolNqvmfQmHftQAr2W/b0b0b0c6725203b945d83da9b190c443/BLOG-3112_2.png" />
          </figure><p>Why? Many web frameworks have come and gone trying to be everything to everyone, aiming to serve the needs of both content-driven websites and web applications.</p><p>The key to Astro’s success: Instead of trying to serve every use case, Astro has stayed focused on <a href="https://docs.astro.build/en/concepts/why-astro/#design-principles"><u>five design principles</u></a>. Astro is…</p><ul><li><p><b>Content-driven:</b> Astro was designed to showcase your content.</p></li><li><p><b>Server-first:</b> Websites run faster when they render HTML on the server.</p></li><li><p><b>Fast by default:</b> It should be impossible to build a slow website in Astro.</p></li><li><p><b>Easy to use:</b> You don’t need to be an expert to build something with Astro.</p></li><li><p><b>Developer-focused:</b> You should have the resources you need to be successful.</p></li></ul><p>Astro’s <a href="https://docs.astro.build/en/concepts/islands/"><u>Islands Architecture</u></a> is a core part of what makes all of this possible. The majority of each page can be fast, static HTML — fast and simple to build by default, oriented around rendering content. And when you need it, you can render a specific part of a page as a client island, using any client UI framework. You can even mix and match multiple frameworks on the same page, whether that’s React.js, Vue, Svelte, Solid, or anything else:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1SjrMUpO9xZb0wxlATkrQo/16afe1efdb57da6b8b17cd804d94cfb2/BLOG-3112_3.png" />
          </figure>
    <div>
      <h3>Bringing back the joy in building websites</h3>
      <a href="#bringing-back-the-joy-in-building-websites">
        
      </a>
    </div>
    <p>The more Astro and Cloudflare started talking, the clearer it became how much we have in common. Cloudflare’s mission is to help build a better Internet — and part of that is to help build a <i>faster</i> Internet. Almost all of us grew up building websites, and we want a world where people have fun building things on the Internet, where anyone can publish to a site that is truly their own.</p><p>When Astro first <a href="https://astro.build/blog/introducing-astro/"><u>launched</u></a> in 2021, it had become painful to build great websites — it felt like a fight with build tools and frameworks. It sounds strange to say it, with the coding agents and powerful LLMs of 2026, but in 2021 it was very hard to build an excellent and fast website without being a domain expert in JavaScript build tooling. So much has gotten better, both because of Astro and in the broader frontend ecosystem, that we take this almost for granted today.</p><p>The Astro project has spent the past five years working to simplify web development. So as LLMs, then vibe coding, and now true coding agents have come along and made it possible for truly anyone to build — Astro provided a foundation that was simple and fast by default. We’ve all seen how much better and faster agents get when building off the right foundation, in a well-structured codebase. More and more, we’ve seen both builders and platforms choose Astro as that foundation.</p><p>We’ve seen this most clearly through the platforms that both Cloudflare and Astro serve, that extend Cloudflare to their own customers in creative ways using <a href="https://developers.cloudflare.com/cloudflare-for-platforms/"><u>Cloudflare for Platforms</u></a>, and have chosen Astro as the framework that their customers build on. </p><p>When you deploy to <a href="https://webflow.com/feature/cloud"><u>Webflow Cloud</u></a>, your Astro site just works and is deployed across Cloudflare’s network. When you start a new project with <a href="https://vibe.wix.com/"><u>Wix Vibe</u></a>, behind the scenes you’re creating an Astro site, running on Cloudflare. And when you generate a developer docs site using <a href="https://www.stainless.com/"><u>Stainless</u></a>, that generates an Astro project, running on Cloudflare, powered by <a href="https://astro.build/blog/stainless-astro-launch/"><u>Starlight</u></a> — a framework built on Astro.</p><p>Each of these platforms is built for a different audience. But what they have in common — beyond their use of Cloudflare and Astro — is they make it <i>fun</i> to create and publish content to the Internet. In a world where everyone can be both a builder and content creator, we think there are still so many more platforms to build and people to reach.</p>
    <div>
      <h3><b>Astro 6 — new local dev server, powered by Vite</b></h3>
      <a href="#astro-6-new-local-dev-server-powered-by-vite">
        
      </a>
    </div>
    <p>Astro 6 is coming, and the first open beta release is <a href="https://astro.build/blog/astro-6-beta/"><u>now available</u></a>. To be one of the first to try it out, run:</p><p><code>npm create astro@latest -- --ref next</code></p><p>Or to upgrade your existing Astro app, run:</p><p><code>npx @astrojs/upgrade beta</code></p><p>Astro 6 brings a brand new development server, built on the <a href="https://vite.dev/guide/api-environment"><u>Vite Environments API</u></a>, that runs your code locally using the same runtime that you deploy to. This means that when you run <code>astro dev</code> with the <a href="https://developers.cloudflare.com/workers/vite-plugin/"><u>Cloudflare Vite plugin</u></a>, your code runs in <a href="https://github.com/cloudflare/workerd"><u>workerd</u></a>, the open-source Cloudflare Workers runtime, and can use <a href="https://developers.cloudflare.com/durable-objects/"><u>Durable Objects</u></a>, <a href="https://developers.cloudflare.com/d1/"><u>D1</u></a>, <a href="https://developers.cloudflare.com/kv/"><u>KV</u></a>, <a href="https://developers.cloudflare.com/agents/"><u>Agents</u></a> and <a href="https://developers.cloudflare.com/workers/runtime-apis/bindings/"><u>more</u></a>. This isn’t just a Cloudflare feature: Any JavaScript runtime with a plugin that uses the Vite Environments API can benefit from this new support, and ensure local dev runs in the same environment, with the same runtime APIs as production.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4YAgzaSkgUr3gxK5Mkh62V/09847d3f15744b6f049864a6e898a343/BLOG-3112_4.png" />
          </figure><p><a href="https://docs.astro.build/en/reference/experimental-flags/live-content-collections/"><u>Live Content Collections</u></a> in Astro are also stable in Astro 6 and out of beta. These content collections let you update data in real time, without requiring a rebuild of your site. This makes it easy to bring in content that changes often, such as the current inventory in a storefront, while still benefitting from the built-in validation and caching that come with Astro’s existing support for <a href="https://v6.docs.astro.build/en/guides/content-collections"><u>content collections</u></a>.</p><p>There’s more to Astro 6, including Astro’s most upvoted feature request — first-class support for Content Security Policy (CSP) — as well as simpler APIs, an upgrade to <a href="https://zod.dev/?id=introduction"><u>Zod</u></a> 4, and more.</p>
    <div>
      <h3>Doubling down on Astro</h3>
      <a href="#doubling-down-on-astro">
        
      </a>
    </div>
    <p>We're thrilled to welcome the Astro team to Cloudflare. We’re excited to keep building, keep shipping, and keep making Astro the best way to build content-driven sites. We’re already thinking about what comes next beyond V6, and we’d love to hear from you.</p><p>To keep up with the latest, follow the <a href="https://astro.build/blog/"><u>Astro blog</u></a> and join the <a href="https://astro.build/chat"><u>Astro Discord</u></a>. Tell us what you’re building!</p><p></p> ]]></content:encoded>
            <category><![CDATA[Acquisitions]]></category>
            <category><![CDATA[Application Services]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Workers AI]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[AI]]></category>
            <guid isPermaLink="false">6snDEFT5jgryV5wPhY4HEj</guid>
            <dc:creator>Fred Schott</dc:creator>
            <dc:creator>Brendan Irvine-Broque</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare's developer platform keeps getting better, faster, and more powerful. Here's everything that's new.]]></title>
            <link>https://blog.cloudflare.com/cloudflare-developer-platform-keeps-getting-better-faster-and-more-powerful/</link>
            <pubDate>Thu, 25 Sep 2025 14:00:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare's developer platform keeps getting better, faster, and more powerful. Here's everything that's new. ]]></description>
            <content:encoded><![CDATA[ <p>When you build on Cloudflare, we consider it our job to do the heavy lifting for you. That’s been true since we <a href="https://blog.cloudflare.com/introducing-cloudflare-workers/"><u>introduced Cloudflare Workers in 2017</u></a>, when we first provided a runtime for you where you could just focus on building. </p><p>That commitment is still true today, and many of today’s announcements are focused on just that — removing friction where possible to free you up to build something great. </p><p>There are only so many blog posts we can write (and that you can read)! We have been busy on a much longer list of new improvements, and many of them we’ve been rolling out consistently over the course of the year. Today’s announcement breaks down all the new capabilities in detail, in one single post. The features being released today include:</p><ul><li><p><a href="#more-node-js-apis-and-packages-just-work-on-workers"><u>Use more APIs from Node.js</u></a> — including node:fs and node:https</p></li><li><p><a href="#ai-search-formerly-autorag-now-with-more-models-to-choose-from"><u>Use models from different providers in AI Search</u></a> (formerly AutoRAG)</p></li><li><p>Deploy <u>l</u>arger container instances and more concurrent instances to our Containers platform</p></li><li><p>Run 30 concurrent headless web browsers (previously 10), via the <a href="#playwright-in-browser-rendering-is-now-ga"><u>Browser Rendering API</u></a></p></li><li><p>Use the <a href="#playwright-in-browser-rendering-is-now-ga"><u>Playwright browser automation library</u></a> with the Browser Rendering API — now fully supported and GA</p></li><li><p>Use 4 vCPUs (prev 2) and 20GB of disk (prev 8GB) with <a href="#more-node-js-apis-and-packages-just-work-on-workers"><u>Workers Builds — now GA</u></a></p></li><li><p>Connect to production services and resources from local development with Remote Bindings — now GA</p></li><li><p><a href="#infrequent-access-in-r2-is-now-ga"><u>R2 Infrequent Access GA</u></a> - lower-cost storage class for backups, logs, and long-tail content</p></li><li><p>Resize, clip and reformat video files on-demand with Media Transformations — now GA</p></li></ul><p>Alongside that, we’re constantly adding new building blocks, to make sure you have all the tools you need to build what you set out to. Those launches (that also went out today, but require a bit more explanation) include:</p><ul><li><p>Connect to Postgres databases <a href="http://blog.cloudflare.com/planetscale-postgres-workers"><u>running on Planetscale</u></a></p></li><li><p>Send transactional emails via the new <a href="http://blog.cloudflare.com/email-service"><u>Cloudflare Email Service</u></a></p></li><li><p>Run distributed SQL queries with the new <a href="http://blog.cloudflare.com/cloudflare-data-platform"><u>Cloudflare Data Platform</u></a></p></li><li><p>Deploy your own <a href="https://www.cloudflare.com/learning/ai/how-to-get-started-with-vibe-coding/">AI vibe coding</a> platform to Cloudflare with <a href="https://blog.cloudflare.com/deploy-your-own-ai-vibe-coding-platform"><u>VibeSDK</u></a></p></li></ul>
    <div>
      <h2>AI Search (formerly AutoRAG) — now with More Models To Choose From</h2>
      <a href="#ai-search-formerly-autorag-now-with-more-models-to-choose-from">
        
      </a>
    </div>
    <p>AutoRAG is now AI Search! The new name marks a new and bigger mission: to make world-class search infrastructure available to every developer and business. AI Search is no longer just about retrieval for LLM apps: it’s about giving you a fast, flexible index for your content that is ready to power any AI experience. With recent additions like <a href="https://blog.cloudflare.com/conversational-search-with-nlweb-and-autorag/"><u>NLWeb support</u></a>, we are expanding beyond simple retrieval to provide a foundation for top quality search experiences that are open and built for the future of the web.</p><p>With AI Search you can now use models from different providers like OpenAI and Anthropic. Last month during AI Week we announced <a href="https://blog.cloudflare.com/ai-gateway-aug-2025-refresh/"><u>BYO Provider Keys for AI Gateway</u></a>. That capability now extends to AI Search. By attaching your keys to the AI Gateway linked to your AI Search instance, you can use many more models for both embedding and inference.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5RUPN3CB5MOHuF0qcaJ9Nq/527f20fb8c2109c2007a5a3eeffaaadc/image2.png" />
          </figure><p>Once configured, your AI Search instance will be able to reference models available through your AI Gateway when making a <code>/ai-search</code> request:</p>
            <pre><code>export default {
  async fetch(request, env) {
    
    // Query your AI Search instance with a natural language question to an OpenAI model
    const result = await env.AI.autorag("my-ai-search").aiSearch({
      query: "What's new for Cloudflare Birthday Week?",
      model: "openai/gpt-5"
    });

    // Return only the generated answer as plain text
    return new Response(result.response, {
      headers: { "Content-Type": "text/plain" },
    });
  },
};</code></pre>
            <p>In the coming weeks we will also roll out updates to align the APIs with the new name. The existing APIs will continue to be supported for the time being. Stay tuned to the AI Search <a href="https://developers.cloudflare.com/changelog/?product=ai-search"><u>Changelog</u></a> and <a href="https://discord.cloudflare.com/"><u>Discord</u></a> for more updates!</p>
    <div>
      <h2>Connect to production services and resources from local development with Remote Bindings — now GA</h2>
      <a href="#connect-to-production-services-and-resources-from-local-development-with-remote-bindings-now-ga">
        
      </a>
    </div>
    <p><a href="https://developers.cloudflare.com/workers/development-testing/#remote-bindings"><u>Remote bindings</u></a> for local development are generally available, supported in <a href="https://developers.cloudflare.com/workers/wrangler/"><u>Wrangler</u></a> v4.37.0, the <a href="https://developers.cloudflare.com/workers/vite-plugin/"><u>Cloudflare Vite plugin</u></a>, and the <code>@cloudflare/vitest-pool-workers</code> package. Remote bindings are bindings that are configured to connect to a deployed resource on your Cloudflare account <i>instead </i>of the locally simulated resource. </p><p>For example, here’s how you can instruct Wrangler or Vite to send all requests to <code>env.MY_BUCKET</code> to hit the real, deployed R2 bucket instead of a locally simulated one: </p>
            <pre><code>{
  "name": "my-worker",
  "compatibility_date": "2025-09-25",

  "r2_buckets": [
    {
      "bucket_name": "my-bucket",
      "binding": "MY_BUCKET",
      "remote": true
    },
  ],
}</code></pre>
            <p>With the above configuration, all requests to <code>env.MY_BUCKET</code> will be proxied to the remote resource, but the Worker code will still execute locally. This means you get all the benefits of local development like faster execution times – without having to seed local databases with data. </p><p>You can pair remote bindings with <a href="https://developers.cloudflare.com/workers/wrangler/environments/"><b><u>environments</u></b></a>, so that you can use staging data during local development and leave production data untouched. </p><p>For example, here’s how you could point Wrangler or Vite to send all requests to <code>env.MY_BUCKET</code> to <code>staging-storage-bucket</code> when you run <code>wrangler dev --env staging</code> (<code>CLOUDFLARE_ENV=staging vite dev</code> if using Vite). </p>
            <pre><code>{
  "name": "my-worker",
  "compatibility_date": "2025-09-25",

"env": {
    "staging": {
      "r2_buckets": [
        {
          "binding": "MY_BUCKET",
          "bucket_name": "staging-storage-bucket",
          "remote": true
        }
      ]
    },
    "production": {
      "r2_buckets": [
        {
          "binding": "MY_BUCKET",
          "bucket_name": "production-storage-bucket" 
        }
      ]
    }
  }
}</code></pre>
            
    <div>
      <h2>More Node.js APIs and packages “just work” on Workers</h2>
      <a href="#more-node-js-apis-and-packages-just-work-on-workers">
        
      </a>
    </div>
    <p>Over the past year, we have been hard at work to make Workers more compatible with Node.js packages and APIs.</p><p>Several weeks ago, <a href="https://blog.cloudflare.com/bringing-node-js-http-servers-to-cloudflare-workers/"><u>we shared how node:http and node:https APIs are now supported on Workers</u></a>. This means that you can run backend Express and Koa.js work with only a few additional lines of code:</p>
            <pre><code>import { httpServerHandler } from 'cloudflare:node';
import express from 'express';

const app = express();

app.get('/', (req, res) =&gt; {
  res.json({ message: 'Express.js running on Cloudflare Workers!' });
});

app.listen(3000);
export default httpServerHandler({ port: 3000 });</code></pre>
            <p>And there’s much, much more. You can now:</p><ul><li><p>Read and write temporary files in Workers, using <code>node:fs</code></p></li><li><p>Do DNS looking using <a href="https://one.one.one.one/"><u>1.1.1.1</u></a> with <code>node:dns</code></p></li><li><p>Use <code>node:net</code> and <code>node:tls</code> for first class Socket support</p></li><li><p>Use common hashing libraries with <code>node:crypto</code></p></li><li><p>Access environment variables in a Node-like fashion on <code>process.env</code></p></li></ul><p><a href="https://blog.cloudflare.com/nodejs-workers-2025"><u>Read our full recap of the last year’s Node.js-related changes</u></a> for all the details.</p><p>With these changes, Workers become even more powerful and easier to adopt, regardless of where you’re coming from. The APIs that you are familiar with are there, and more packages you need will just work.</p>
    <div>
      <h2>Larger Container instances, more concurrent instances</h2>
      <a href="#larger-container-instances-more-concurrent-instances">
        
      </a>
    </div>
    <p><a href="https://developers.cloudflare.com/containers/"><u>Cloudflare Containers</u></a> now has higher limits on concurrent instances and an upcoming new, larger instance type.</p><p>Previously you could run 50 instances of the <code>dev</code> instance type or 25 instances of the <code>basic</code> instance type concurrently. Now you can run concurrent containers with up to 400 GiB of memory, 100 vCPUs, and 2 TB of disk. This allows you to run up to 1000 <code>dev</code> instances or 400 <code>basic</code> instances concurrently. Enterprise customers can push far beyond these limits — contact us if you need more. If you are using Containers to power your app and it goes viral, you’ll have the ability to scale on Cloudflare.</p><p>Cloudflare Containers also now has a new <a href="https://developers.cloudflare.com/containers/platform-details/limits/"><u>instance type</u></a> coming soon — <code>standard-2</code> which includes 8 GiB of memory, 1 vCPU, and 12 GB of disk. This new instance type is an ideal default for workloads that need more resources, from <a href="https://github.com/cloudflare/sandbox-sdk"><u>AI Sandboxes</u></a> to data processing jobs.</p>
    <div>
      <h2>Workers Builds provides more disk and CPU — and is now GA</h2>
      <a href="#workers-builds-provides-more-disk-and-cpu-and-is-now-ga">
        
      </a>
    </div>
    <p>Last Birthday Week, we <a href="https://blog.cloudflare.com/builder-day-2024-announcements/#continuous-integration-and-delivery"><u>announced the launch</u></a> of our integrated <a href="https://www.cloudflare.com/learning/serverless/glossary/what-is-ci-cd/">CI/CD pipeline</a>, Workers Builds, in open beta. We also gave you <a href="https://blog.cloudflare.com/workers-builds-integrated-ci-cd-built-on-the-workers-platform/"><u>a detailed look</u></a> into how we built this system on our <a href="https://developers.cloudflare.com/workers/"><u>Workers platform</u></a> using <a href="https://developers.cloudflare.com/containers/"><u>Containers</u></a>, <a href="https://developers.cloudflare.com/durable-objects/"><u>Durable Objects</u></a>, <a href="https://developers.cloudflare.com/hyperdrive/"><u>Hyperdrive</u></a>, <a href="https://developers.cloudflare.com/log-explorer/log-search/"><u>Workers Logs</u></a>, and <a href="https://developers.cloudflare.com/workers/configuration/smart-placement/"><u>Smart Placement</u></a>.</p><p>This year, we are excited to announce that Workers Builds is now Generally Available. Here’s what’s new:</p><ul><li><p><a href="https://developers.cloudflare.com/changelog/2025-08-04-builds-increased-disk-size/"><b><u>Increased disk space for all plans</u></b></a>: We've increased the disk size from 8 GB to 20 GB for both free and paid plans, giving you more space for your projects and dependencies</p></li><li><p><a href="https://developers.cloudflare.com/changelog/2025-09-07-builds-increased-cpu-paid/"><b><u>More compute for paid plans</u></b></a>: We’ve doubled the CPU power for paid plans from 2 vCPU to 4 vCPU, making your builds significantly faster</p></li><li><p><b>Faster single-core and multi-core performance</b>: To ensure consistent, high performance builds, we now run your builds on the fastest available CPUs at the time your build runs</p></li></ul><p>Haven’t used <a href="https://developers.cloudflare.com/workers/ci-cd/builds/"><u>Workers Builds</u></a> yet? You can try it by <a href="https://developers.cloudflare.com/workers/ci-cd/builds/"><u>connecting a Git repository to an existing Worker</u></a>, or try it out on a fresh new project by clicking any <a href="https://developers.cloudflare.com/workers/platform/deploy-buttons/"><u>Deploy to Cloudflare button</u></a>, like the one below that deploys <a href="https://github.com/cloudflare/templates/tree/main/astro-blog-starter-template"><u>a blog built with Astro</u></a> to your Cloudflare account:</p><a href="https://deploy.workers.cloudflare.com/?url=https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/templates/tree/main/astro-blog-starter-template"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p>
    <div>
      <h2>A more consistent look and feel for the Cloudflare dashboard</h2>
      <a href="#a-more-consistent-look-and-feel-for-the-cloudflare-dashboard">
        
      </a>
    </div>
    <p><a href="https://dash.cloudflare.com/?to=/:account/workers/durable-objects"><u>Durable Objects</u></a>, <a href="https://dash.cloudflare.com/?to=/:account/r2"><u>R2</u></a>, and <a href="https://dash.cloudflare.com/?to=/:account/workers-and-pages"><u>Workers</u></a> now all have a more consistent look with the rest of our developer platform. As you explore these pages you’ll find that things should load faster, feel smoother and are easier to use.</p><p>Across storage products, you can now customize the table that lists the resources on your account, choose which data you want to see, sort by any column, and hide columns you don’t need. In the Workers and Pages dashboard, we’ve reduced clutter and have modernized the design to make it faster for you to get the data you need.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/0NkomTAkx45wn7nF4WYip/efb7b706d0ab7df34bfe229a025f4782/image4.png" />
          </figure><p>And when you create a new <a href="https://developers.cloudflare.com/pipelines/"><u>Pipeline</u></a> or a <a href="https://developers.cloudflare.com/hyperdrive"><u>Hyperdrive</u></a> configuration, you’ll find a new interface that helps you get started and guides you through each step.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2Lx2tgIBRIWsq82p3Vjj3o/3a23f7065c9f354ed66dbe311f5d1d86/image1.png" />
          </figure><p>This work is ongoing, and we’re excited to continue improving with the help of your feedback, so keep it coming!</p>
    <div>
      <h2>Resize, clip and reformat video files on-demand with Media Transformations — now GA</h2>
      <a href="#resize-clip-and-reformat-video-files-on-demand-with-media-transformations-now-ga">
        
      </a>
    </div>
    <p>In March 2025 we <a href="https://blog.cloudflare.com/media-transformations-for-video-open-beta/"><u>announced Media Transformations</u></a> in open beta, which brings the magic of <a href="https://developers.cloudflare.com/images/transform-images/"><u>Image transformations</u></a> to short-form video files — including video files stored outside of Cloudflare. Since then, we have increased input and output limits, and added support for audio-only extraction. Media Transformations is now generally available.</p><p>Media Transformations is ideal if you have a large existing volume of short videos, such as generative AI output, e-commerce product videos, social media clips, or short marketing content. Content like this should be fetched from your existing storage like R2 or S3 directly, optimized by Cloudflare quickly, and delivered efficiently as small MP4 files or used to extract still images and audio.</p>
            <pre><code>https://example.com/cdn-cgi/media/&lt;OPTIONS&gt;/&lt;SOURCE-VIDEO&gt;

EXAMPLE, RESIZE:
https://example.com/cdn-cgi/media/width=760/https://pub-d9fcbc1abcd244c1821f38b99017347f.r2.dev/aus-mobile.mp4


EXAMPLE, STILL THUMBNAIL:
https://example.com/cdn-cgi/media/mode=frame,time=3s,width=120,height=120,fit=cover/https://pub-d9fcbc1abcd244c1821f38b99017347f.r2.dev/aus-mobile.mp4</code></pre>
            <p>Media Transformations includes a free tier available to all customers and is included with Media Platform subscriptions. Check out the <a href="https://developers.cloudflare.com/stream/transform-videos/"><u>transform videos documentation</u></a> for all the latest, then enable transformations for your zone today!</p>
    <div>
      <h2>Infrequent Access in R2 is now GA</h2>
      <a href="#infrequent-access-in-r2-is-now-ga">
        
      </a>
    </div>
    <p>R2 Infrequent Access is now generally available. Last year, we introduced the <a href="https://blog.cloudflare.com/r2-events-gcs-migration-infrequent-access/#infrequent-access-private-beta"><u>Infrequent Access</u></a> storage class designed for data that doesn’t need to be accessed frequently. It’s a great fit for use cases including long-tail user content, logs, or data backups.</p><p>Since launch, Infrequent Access has been proven in production by our customers running these types of workloads at scale. The results confirmed our goal: a storage class that reduces storage costs while maintaining performance and durability.</p><p><a href="https://developers.cloudflare.com/r2/pricing/"><u>Pricing</u></a> is simple. You pay less on data storage, while data retrievals are billed per GB to reflect the additional compute required to serve data from underlying storage optimized for less frequent access. And as with all of R2, there are <b>no egress fees</b>, so you don’t pay for the bandwidth to move data out.

Here’s how you can upload an object to R2 infrequent access class via Workers:</p>
            <pre><code>export default {
  async fetch(request, env) {

    // Upload the incoming request body to R2 in Infrequent Access class
    await env.MY_BUCKET.put("my-object", request.body, {
      storageClass: "InfrequentAccess",
    });

    return new Response("Object uploaded to Infrequent Access!", {
      headers: { "Content-Type": "text/plain" },
    });
  },
};</code></pre>
            <p>You can also monitor your Infrequent Access vs. Standard storage usage directly in your R2 dashboard for each bucket. Get started with <a href="https://developers.cloudflare.com/r2/get-started/"><u>R2</u></a> today!</p>
    <div>
      <h2>Playwright in Browser Rendering is now GA</h2>
      <a href="#playwright-in-browser-rendering-is-now-ga">
        
      </a>
    </div>
    <p>We’re excited to announce three updates to Browser Rendering:</p><ol><li><p>Our support for <a href="https://developers.cloudflare.com/browser-rendering/platform/playwright/"><u>Playwright</u></a> is now Generally Available, giving developers the stability and confidence to run critical browser tasks.</p></li><li><p>We’re introducing support for <a href="https://developers.cloudflare.com/browser-rendering/platform/stagehand/"><u>Stagehand</u></a>, enabling developers to build AI agents using natural language, powered by Cloudflare Workers AI.</p></li><li><p>Finally, to help developers scale, we are tripling <a href="https://developers.cloudflare.com/browser-rendering/platform/limits/#workers-paid"><u>limits for paid plans</u></a>, with more increases to come. </p></li></ol><p>The browser is no longer only used by humans. AI agents need to be able to reliably navigate browsers in the same way a human would, whether that's booking flights, filling in customer info, or scraping structured data. Playwright gives AI agents the ability to interact with web pages and perform complex tasks on behalf of humans. However, running browsers at scale is a significant infrastructure challenge. Cloudflare Browser Rendering solves this by providing headless browsers on-demand. By moving Playwright support to Generally Available, and now synced with the latest version v1.55, customers have a production-ready foundation to build reliable, scalable applications on. </p><p>To help AI agents better navigate the web, we’re introducing support for Stagehand, an open source browser automation framework.  Rather than dictating exact steps or specifying selectors, Stagehand enables developers to build more reliably and flexibly by combining code with natural-language instructions powered by AI. This makes it possible for AI agents to navigate and adapt if a website changes - just like a human would. </p><p>To get started with Playwright and Stagehand, check our <a href="https://developers.cloudflare.com/changelog/2025-09-25-br-playwright-ga-stagehand-limits/"><u>changelog</u></a> with code examples and more. </p><div>
  
</div><p></p> ]]></content:encoded>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <guid isPermaLink="false">4HnTgcx06k7ccxS0rYwIkC</guid>
            <dc:creator>Brendan Irvine-Broque</dc:creator>
            <dc:creator>Rita Kozlov</dc:creator>
            <dc:creator>Korinne Alpers</dc:creator>
        </item>
        <item>
            <title><![CDATA[Build and deploy Remote Model Context Protocol (MCP) servers to Cloudflare]]></title>
            <link>https://blog.cloudflare.com/remote-model-context-protocol-servers-mcp/</link>
            <pubDate>Tue, 25 Mar 2025 13:59:00 GMT</pubDate>
            <description><![CDATA[ You can now build and deploy remote MCP servers to Cloudflare, and we handle the hard parts of building remote MCP servers for you. ]]></description>
            <content:encoded><![CDATA[ <p>It feels like almost everyone building AI applications and <a href="https://www.cloudflare.com/learning/ai/what-is-agentic-ai/">agents</a> is talking about the <a href="https://www.cloudflare.com/learning/ai/what-is-model-context-protocol-mcp/">Model Context Protocol</a> (MCP), as well as building MCP servers that you install and run locally on your own computer.</p><p>You can now <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>build and deploy remote MCP servers</u></a> to Cloudflare. We’ve added four things to Cloudflare that handle the hard parts of building remote MCP servers for you:</p><ol><li><p><a href="https://developers.cloudflare.com/agents/model-context-protocol/authorization"><u>workers-oauth-provider</u></a> — an <a href="https://www.cloudflare.com/learning/access-management/what-is-oauth/"><u>OAuth</u></a> Provider that makes authorization easy</p></li><li><p><a href="https://developers.cloudflare.com/agents/model-context-protocol/tools/"><u>McpAgent</u></a> — a class built into the <a href="https://developers.cloudflare.com/agents/"><u>Cloudflare Agents SDK</u></a> that handles remote transport</p></li><li><p><a href="https://developers.cloudflare.com/agents/guides/test-remote-mcp-server/"><u>mcp-remote</u></a> — an adapter that lets MCP clients that otherwise only support local connections work with remote MCP servers</p></li><li><p><a href="https://playground.ai.cloudflare.com/"><u>AI playground as a remote MCP client</u></a> — a chat interface that allows you to connect to remote MCP servers, with the authentication check included</p></li></ol><p>The button below, or the <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>developer docs</u></a>, will get you up and running in production with <a href="https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-server"><u>this example MCP server</u></a> in less than two minutes:</p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-server"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p><p>Unlike the local MCP servers you may have previously used, remote MCP servers are accessible on the Internet. People simply sign in and grant permissions to MCP clients using familiar authorization flows. We think this is going to be a massive deal — connecting coding agents to MCP servers has blown developers’ minds over the past few months, and remote MCP servers have the same potential to open up similar new ways of working with LLMs and agents to a much wider audience, including more everyday consumer use cases.</p>
    <div>
      <h2>From local to remote — bringing MCP to the masses</h2>
      <a href="#from-local-to-remote-bringing-mcp-to-the-masses">
        
      </a>
    </div>
    <p>MCP is quickly becoming the common protocol that enables LLMs to go beyond <a href="https://www.cloudflare.com/learning/ai/inference-vs-training/"><u>inference</u></a> and <a href="https://developers.cloudflare.com/reference-architecture/diagrams/ai/ai-rag/"><u>RAG</u></a>, and take actions that require access beyond the AI application itself (like sending an email, deploying a code change, publishing blog posts, you name it). It enables AI agents (MCP clients) to access tools and resources from external services (MCP servers).</p><p>To date, MCP has been limited to running locally on your own machine — if you want to access a tool on the web using MCP, it’s up to you to set up the server locally. You haven’t been able to use MCP from web-based interfaces or mobile apps, and there hasn’t been a way to let people authenticate and grant the MCP client permission. Effectively, MCP servers haven’t yet been brought online.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1EyiTXzB4FvBs2zEfzuNTp/5ce4b55457348e9ab83e6d9cf35d8c3c/image7.png" />
          </figure><p>Support for <a href="https://spec.modelcontextprotocol.io/specification/draft/basic/transports/#streamable-http"><u>remote MCP connections</u></a> changes this. It creates the opportunity to reach a wider audience of Internet users who aren’t going to install and run MCP servers locally for use with desktop apps. Remote MCP support is like the transition from desktop software to web-based software. People expect to continue tasks across devices and to login and have things just work. Local MCP is great for developers, but remote MCP connections are the missing piece to reach everyone on the Internet.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7bI7rJtLh89jmZaibSgiLl/e426f93616a8210d80b979c47d89dc75/image4.png" />
          </figure>
    <div>
      <h2>Making authentication and authorization just work with MCP</h2>
      <a href="#making-authentication-and-authorization-just-work-with-mcp">
        
      </a>
    </div>
    <p>Beyond just changing the transport layer — from <a href="https://modelcontextprotocol.io/docs/concepts/transports#standard-input%2Foutput-stdio"><u>stdio</u></a> to <a href="https://github.com/modelcontextprotocol/specification/pull/206"><u>streamable HTTP</u></a> — when you build a remote MCP server that uses information from the end user’s account, you need <a href="https://www.cloudflare.com/learning/access-management/authn-vs-authz/"><u>authentication and authorization</u></a>. You need a way to allow users to login and prove who they are (authentication) and a way for users to control what the AI agent will be able to access when using a service (authorization).</p><p>MCP does this with <a href="https://oauth.net/2/"><u>OAuth</u></a>, which has been the standard protocol that allows users to grant applications to access their information or services, without sharing passwords. Here, the MCP Server itself acts as the OAuth Provider. However, OAuth with MCP is hard to implement yourself, so when you build MCP servers on Cloudflare we provide it for you.</p>
    <div>
      <h3>workers-oauth-provider — an OAuth 2.1 Provider library for Cloudflare Workers</h3>
      <a href="#workers-oauth-provider-an-oauth-2-1-provider-library-for-cloudflare-workers">
        
      </a>
    </div>
    <p>When you <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>deploy an MCP Server</u></a> to Cloudflare, your Worker acts as an OAuth Provider, using <a href="https://github.com/cloudflare/workers-oauth-provider"><u>workers-oauth-provider</u></a>, a new TypeScript library that wraps your Worker’s code, adding authorization to API endpoints, including (but not limited to) MCP server API endpoints.</p><p>Your MCP server will receive the already-authenticated user details as a parameter. You don’t need to perform any checks of your own, or directly manage tokens. You can still fully control how you authenticate users: from what UI they see when they log in, to which provider they use to log in. You can choose to bring your own third-party authentication and authorization providers like Google or GitHub, or integrate with your own.</p><p>The complete <a href="https://spec.modelcontextprotocol.io/specification/draft/basic/authorization/"><u>MCP OAuth flow</u></a> looks like this:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/VTPBfZ4hRPdq2TWE5VOjS/00abc97e4beedf59a4101957612fd503/image5.png" />
          </figure><p>Here, your MCP server acts as both an OAuth client to your upstream service, <i>and</i> as an OAuth server (also referred to as an OAuth “provider”) to MCP clients. You can use any upstream authentication flow you want, but workers-oauth-provider guarantees that your MCP server is <a href="https://spec.modelcontextprotocol.io/specification/draft/basic/authorization"><u>spec-compliant</u></a> and able to work with the full range of client apps &amp; websites. This includes support for Dynamic Client Registration (<a href="https://datatracker.ietf.org/doc/html/rfc7591"><u>RFC 7591</u></a>) and Authorization Server Metadata (<a href="https://datatracker.ietf.org/doc/html/rfc8414"><u>RFC 8414</u></a>).</p>
    <div>
      <h3>A simple, pluggable interface for OAuth</h3>
      <a href="#a-simple-pluggable-interface-for-oauth">
        
      </a>
    </div>
    <p>When you build an MCP server with Cloudflare Workers, you provide an instance of the OAuth Provider paths to your authorization, token, and client registration endpoints, along with <a href="https://developers.cloudflare.com/workers/runtime-apis/handlers/fetch/"><u>handlers</u></a> for your MCP Server, and for auth:</p>
            <pre><code>import OAuthProvider from "@cloudflare/workers-oauth-provider";
import MyMCPServer from "./my-mcp-server";
import MyAuthHandler from "./auth-handler";

export default new OAuthProvider({
  apiRoute: "/sse", // MCP clients connect to your server at this route
  apiHandler: MyMCPServer.mount('/sse'), // Your MCP Server implmentation
  defaultHandler: MyAuthHandler, // Your authentication implementation
  authorizeEndpoint: "/authorize",
  tokenEndpoint: "/token",
  clientRegistrationEndpoint: "/register",
});</code></pre>
            <p>This abstraction lets you easily plug in your own authentication. Take a look at <a href="https://github.com/cloudflare/ai/blob/main/demos/remote-mcp-github-oauth/src/github-handler.ts"><u>this example</u></a> that uses GitHub as the identity provider for an MCP server, in less than 100 lines of code, by implementing /callback and /authorize routes.</p>
    <div>
      <h3>Why do MCP servers issue their own tokens?</h3>
      <a href="#why-do-mcp-servers-issue-their-own-tokens">
        
      </a>
    </div>
    <p>You may have noticed in the authorization diagram above, and in the <a href="https://spec.modelcontextprotocol.io/specification/draft/basic/authorization"><u>authorization section</u></a> of the MCP spec, that the MCP server issues its own token to the MCP client.</p><p>Instead of passing the token it receives from the upstream provider directly to the MCP client, your Worker stores an encrypted access token in <a href="https://developers.cloudflare.com/kv/"><u>Workers KV</u></a>. It then issues its own token to the client. As shown in the <a href="https://github.com/cloudflare/ai/blob/main/demos/remote-mcp-github-oauth/src/github-handler.ts"><u>GitHub example</u></a> above, this is handled on your behalf by the workers-oauth-provider — your code never directly handles writing this token, preventing mistakes. You can see this in the following code snippet from the <a href="https://github.com/cloudflare/ai/blob/main/demos/remote-mcp-github-oauth/src/github-handler.ts"><u>GitHub example</u></a> above:</p>
            <pre><code>  // When you call completeAuthorization, the accessToken you pass to it
  // is encrypted and stored, and never exposed to the MCP client
  // A new, separate token is generated and provided to the client at the /token endpoint
  const { redirectTo } = await c.env.OAUTH_PROVIDER.completeAuthorization({
    request: oauthReqInfo,
    userId: login,
    metadata: { label: name },
    scope: oauthReqInfo.scope,
    props: {
      accessToken,  // Stored encrypted, never sent to MCP client
    },
  })

  return Response.redirect(redirectTo)</code></pre>
            <p>On the surface, this indirection might sound more complicated. Why does it work this way?</p><p>By issuing its own token, MCP Servers can restrict access and enforce more granular controls than the upstream provider. If a token you issue to an MCP client is compromised, the attacker only gets the limited permissions you've explicitly granted through your MCP tools, not the full access of the original token.</p><p>Let’s say your MCP server requests that the user authorize permission to read emails from their Gmail account, using the <a href="https://developers.google.com/identity/protocols/oauth2/scopes#gmail"><u>gmail.readonly scope</u></a>. The tool that the MCP server exposes is more narrow, and allows reading travel booking notifications from a limited set of senders, to handle a question like “What’s the check-out time for my hotel room tomorrow?” You can enforce this constraint in your MCP server, and if the token you issue to the MCP client is compromised, because the token is to your MCP server — and not the raw token to the upstream provider (Google) — an attacker cannot use it to read arbitrary emails. They can only call the tools your MCP server provides. OWASP calls out <a href="https://genai.owasp.org/llmrisk/llm062025-excessive-agency/"><u>“Excessive Agency”</u></a> as one of the top risk factors for building AI applications, and by issuing its own token to the client and enforcing constraints, your MCP server can limit tools access to only what the client needs.</p><p>Or building off the earlier GitHub example, you can enforce that only a specific user is allowed to access a particular tool. In the example below, only users that are part of an allowlist can see or call the generateImage tool, that uses <a href="https://developers.cloudflare.com/workers-ai/"><u>Workers AI</u></a> to generate an image based on a prompt:</p>
            <pre><code>import { McpAgent } from "agents/mcp";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

const USER_ALLOWLIST = ["geelen"];

export class MyMCP extends McpAgent&lt;Props, Env&gt; {
  server = new McpServer({
    name: "Github OAuth Proxy Demo",
    version: "1.0.0",
  });

  async init() {
    // Dynamically add tools based on the user's identity
    if (USER_ALLOWLIST.has(this.props.login)) {
      this.server.tool(
        'generateImage',
        'Generate an image using the flux-1-schnell model.',
        {
          prompt: z.string().describe('A text description of the image you want to generate.')
        },
        async ({ prompt }) =&gt; {
          const response = await this.env.AI.run('@cf/black-forest-labs/flux-1-schnell', { 
            prompt, 
            steps: 8 
          })
          return {
            content: [{ type: 'image', data: response.image!, mimeType: 'image/jpeg' }],
          }
        }
      )
    }
  }
}
</code></pre>
            
    <div>
      <h2>Introducing McpAgent: remote transport support that works today, and will work with the revision to the MCP spec</h2>
      <a href="#introducing-mcpagent-remote-transport-support-that-works-today-and-will-work-with-the-revision-to-the-mcp-spec">
        
      </a>
    </div>
    <p>The next step to opening up MCP beyond your local machine is to open up a remote transport layer for communication. MCP servers you run on your local machine just communicate over <a href="https://modelcontextprotocol.io/docs/concepts/transports#standard-input%2Foutput-stdio"><u>stdio</u></a>, but for an MCP server to be callable over the Internet, it must implement <a href="https://spec.modelcontextprotocol.io/specification/draft/basic/transports/#http-with-sse"><u>remote transport</u></a>.</p><p>The <a href="https://github.com/cloudflare/agents/blob/2f82f51784f4e27292249747b5fbeeef94305552/packages/agents/src/mcp.ts"><u>McpAgent</u></a> class we introduced today as part of our <a href="https://github.com/cloudflare/agents"><u>Agents SDK</u></a> handles this for you, using <a href="https://developers.cloudflare.com/durable-objects/"><u>Durable Objects</u></a> behind the scenes to hold a persistent connection open, so that the MCP client can send <a href="https://modelcontextprotocol.io/docs/concepts/transports#server-sent-events-sse"><u>server-sent events (SSE)</u></a> to your MCP server. You don’t have to write code to deal with transport or serialization yourself. A minimal MCP server in 15 lines of code can look like this:</p>
            <pre><code>import { McpAgent } from "agents/mcp";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

export class MyMCP extends McpAgent {
  server = new McpServer({
    name: "Demo",
    version: "1.0.0",
  });
  async init() {
    this.server.tool("add", { a: z.number(), b: z.number() }, async ({ a, b }) =&gt; ({
      content: [{ type: "text", text: String(a + b) }],
    }));
  }
}</code></pre>
            <p>After much <a href="https://github.com/modelcontextprotocol/specification/discussions/102"><u>discussion</u></a>, remote transport in the MCP spec is changing, with <a href="https://github.com/modelcontextprotocol/specification/pull/206"><u>Streamable HTTP replacing HTTP+SSE</u></a> This allows for stateless, pure HTTP connections to MCP servers, with an option to upgrade to SSE, and removes the need for the MCP client to send messages to a separate endpoint than the one it first connects to. The McpAgent class will change with it and just work with streamable HTTP, so that you don’t have to start over to support the revision to how transport works.</p><p>This applies to future iterations of transport as well. Today, the vast majority of MCP servers only expose tools, which are simple <a href="https://en.wikipedia.org/wiki/Remote_procedure_call"><u>remote procedure call (RPC)</u></a> methods that can be provided by a stateless transport. But more complex human-in-the-loop and agent-to-agent interactions will need <a href="https://modelcontextprotocol.io/docs/concepts/prompts"><u>prompts</u></a> and <a href="https://modelcontextprotocol.io/docs/concepts/sampling"><u>sampling</u></a>. We expect these types of chatty, two-way interactions will need to be real-time, which will be challenging to do well without a bidirectional transport layer. When that time comes, Cloudflare, the <a href="https://developers.cloudflare.com/agents/"><u>Agents SDK</u></a>, and Durable Objects all natively support <a href="https://developers.cloudflare.com/durable-objects/best-practices/websockets/"><u>WebSockets</u></a>, which enable full-duplex, bidirectional real-time communication. </p>
    <div>
      <h2>Stateful, agentic MCP servers</h2>
      <a href="#stateful-agentic-mcp-servers">
        
      </a>
    </div>
    <p>When you build MCP servers on Cloudflare, each MCP client session is backed by a Durable Object, via the <a href="https://developers.cloudflare.com/agents/"><u>Agents SDK</u></a>. This means each session can manage and persist its own state, <a href="https://developers.cloudflare.com/agents/api-reference/store-and-sync-state/"><u>backed by its own SQL database</u></a>.</p><p>This opens the door to building stateful MCP servers. Rather than just acting as a stateless layer between a client app and an external API, MCP servers on Cloudflare can themselves be stateful applications — games, a shopping cart plus checkout flow, a <a href="https://github.com/modelcontextprotocol/servers/tree/main/src/memory"><u>persistent knowledge graph</u></a>, or anything else you can dream up. When you build on Cloudflare, MCP servers can be much more than a layer in front of your REST API.</p><p>To understand the basics of how this works, let’s look at a minimal example that increments a counter:</p>
            <pre><code>import { McpAgent } from "agents/mcp";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

type State = { counter: number }

export class MyMCP extends McpAgent&lt;Env, State, {}&gt; {
  server = new McpServer({
    name: "Demo",
    version: "1.0.0",
  });

  initialState: State = {
    counter: 1,
  }

  async init() {
    this.server.resource(`counter`, `mcp://resource/counter`, (uri) =&gt; {
      return {
        contents: [{ uri: uri.href, text: String(this.state.counter) }],
      }
    })

    this.server.tool('add', 'Add to the counter, stored in the MCP', { a: z.number() }, async ({ a }) =&gt; {
      this.setState({ ...this.state, counter: this.state.counter + a })

      return {
        content: [{ type: 'text', text: String(`Added ${a}, total is now ${this.state.counter}`) }],
      }
    })
  }

  onStateUpdate(state: State) {
    console.log({ stateUpdate: state })
  }

}</code></pre>
            <p>For a given session, the MCP server above will remember the state of the counter across tool calls.</p><p>From within an MCP server, you can use Cloudflare’s whole developer platform, and have your MCP server <a href="https://developers.cloudflare.com/agents/api-reference/browse-the-web/"><u>spin up its own web browser</u></a>, <a href="https://developers.cloudflare.com/agents/api-reference/run-workflows/"><u>trigger a Workflow</u></a>, <a href="https://developers.cloudflare.com/agents/api-reference/using-ai-models/"><u>call AI models</u></a>, and more. We’re excited to see the MCP ecosystem evolve into more advanced use cases.</p>
    <div>
      <h2>Connect to remote MCP servers from MCP clients that today only support local MCP</h2>
      <a href="#connect-to-remote-mcp-servers-from-mcp-clients-that-today-only-support-local-mcp">
        
      </a>
    </div>
    <p>Cloudflare is supporting remote MCP early — before the most prominent MCP client applications support remote, authenticated MCP, and before other platforms support remote MCP. We’re doing this to give you a head start building for where MCP is headed.</p><p>But if you build a remote MCP server today, this presents a challenge — how can people start using your MCP server if there aren’t MCP clients that support remote MCP?</p><p>We have two new tools that allow you to test your remote MCP server and simulate how users will interact with it in the future:</p><p>We updated the <a href="https://playground.ai.cloudflare.com/"><u>Workers AI Playground</u></a> to be a fully remote MCP client that allows you to connect to any remote MCP server with built-in authentication support. This online chat interface lets you immediately test your remote MCP servers without having to install anything on your device. Instead, just enter the remote MCP server’s URL (e.g. https://remote-server.example.com/sse) and click Connect.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4N64nJHJiQygmMdSK7clIs/c0bf8c64f1607674f81be10c3871a64b/image1.png" />
          </figure><p>Once you click Connect, you’ll go through the authentication flow (if you set one up) and after, you will be able to interact with the MCP server tools directly from the chat interface.</p><p>If you prefer to use a client like Claude Desktop or Cursor that already supports MCP but doesn’t yet handle remote connections with authentication, you can use <a href="https://www.npmjs.com/package/mcp-remote"><u>mcp-remote</u></a>. mcp-remote is an adapter that  lets MCP clients that otherwise only support local connections to work with remote MCP servers. This gives you and your users the ability to preview what interactions with your remote MCP server will be like from the tools you’re already using today, without having to wait for the client to support remote MCP natively. </p><p>We’ve <a href="https://developers.cloudflare.com/agents/guides/test-remote-mcp-server/"><u>published a guide</u></a> on how to use mcp-remote with popular MCP clients including Claude Desktop, Cursor, and Windsurf. In Claude Desktop, you add the following to your configuration file:</p>
            <pre><code>{
  "mcpServers": {
    "remote-example": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://remote-server.example.com/sse"
      ]
    }
  }
}</code></pre>
            
    <div>
      <h2>1800-mcp@cloudflare.com — start building remote MCP servers today</h2>
      <a href="#1800-mcp-cloudflare-com-start-building-remote-mcp-servers-today">
        
      </a>
    </div>
    <p>Remote Model Context Protocol (MCP) is coming! When client apps support remote MCP servers, the audience of people who can use them opens up from just us, developers, to the rest of the population — who may never even know what MCP is or stands for. </p><p>Building a remote MCP server is the way to bring your service into the AI assistants and tools that millions of people use. We’re excited to see many of the biggest companies on the Internet are busy building MCP servers right now, and we are curious about the businesses that pop-up in an agent-first, MCP-native way.</p><p>On Cloudflare, <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>you can start building today</u></a>. We’re ready for you, and ready to help build with you. Email us at <a><u>1800-mcp@cloudflare.com</u></a>, and we’ll help get you going. There’s lots more to come with MCP, and we’re excited to see what you build.</p> ]]></content:encoded>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[MCP]]></category>
            <category><![CDATA[Agents]]></category>
            <guid isPermaLink="false">4e3J8mxEIN24iNKfw9ToEH</guid>
            <dc:creator>Brendan Irvine-Broque</dc:creator>
            <dc:creator>Dina Kozlov</dc:creator>
            <dc:creator>Glen Maddern</dc:creator>
        </item>
        <item>
            <title><![CDATA[Wrapping up another Birthday Week celebration]]></title>
            <link>https://blog.cloudflare.com/birthday-week-2024-wrap-up/</link>
            <pubDate>Mon, 30 Sep 2024 13:00:00 GMT</pubDate>
            <description><![CDATA[ Recapping all the big announcements made during 2024’s Birthday Week. ]]></description>
            <content:encoded><![CDATA[ <p>2024 marks Cloudflare’s 14th birthday. Birthday Week each year is packed with major announcements and the release of innovative new offerings, all focused on giving back to our customers and the broader Internet community. Birthday Week has become a proud tradition at Cloudflare and our culture, to not just stay true to our mission, but to always stay close to our customers. We begin planning for this week of celebration earlier in the year and invite everyone at Cloudflare to participate.</p><p>Months before Birthday Week, we invited teams to submit ideas for what to announce. We were flooded with submissions, from proposals for implementing new standards to creating new products for developers. Our biggest challenge is finding space for it all in just one week — there is still so much to build. Good thing we have a birthday to celebrate each year, but we might need an extra day in Birthday Week next year!</p><p>In case you missed it, here’s everything we announced during 2024’s Birthday Week:</p>
    <div>
      <h3>Monday</h3>
      <a href="#monday">
        
      </a>
    </div>
    <div>
    <figure>
        <table>
            <colgroup>
                <col></col>
                <col></col>
            </colgroup>
            <tbody>
                <tr>
                    <td>
                        <p><span><span>What</span></span></p>
                    </td>
                    <td>
                        <p><span><span>In a sentence…</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/cloudflare-ai-audit-control-ai-content-crawlers"><span><span><u>Start auditing and controlling the AI models accessing your content</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Understand which AI-related bots and crawlers can access your website, and which content you choose to allow them to consume.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/batched-dns-changes/"><span><span><u>Making zone management more efficient with batch DNS record updates</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Customers using Cloudflare to manage DNS can create a whole batch of records, enable </span></span><a href="https://developers.cloudflare.com/dns/manage-dns-records/reference/proxied-dns-records/"><span><span>proxying</span></span></a><span><span> on many records, update many records to point to a new target at the same time, or even delete all of their records.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/turnstile-ephemeral-ids-for-fraud-detection"><span><span><u>Introducing Ephemeral IDs: a new tool for fraud detection</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Taking the next step in advancing security with Ephemeral IDs, a new feature that generates a unique short-lived ID, without relying on any network-level information.</span></span></p>
                        <p> </p>
                    </td>
                </tr>
            </tbody>
        </table>
    </figure>
</div>
    <div>
      <h3>Tuesday</h3>
      <a href="#tuesday">
        
      </a>
    </div>
    <div>
    <figure>
        <table>
            <colgroup>
                <col></col>
                <col></col>
            </colgroup>
            <tbody>
                <tr>
                    <td>
                        <p><span><span>What</span></span></p>
                    </td>
                    <td>
                        <p><span><span>In a sentence…</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/safer-resolver/"><span><span><u>Cloudflare partners to deliver safer browsing experience to homes</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Internet service, network, and hardware equipment providers can </span></span><a href="https://docs.google.com/spreadsheets/d/1ZIBbVz2gqPBsldhszk_Wo2eZeNwAZ5Mf9xSssxRrTuc/edit?resourcekey=&amp;gid=386353769#gid=386353769"><span><span><u>sign up</u></span></span></a><span><span> and partner with Cloudflare to deliver a safer browsing experience to homes.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/a-safer-internet-with-cloudflare/"><span><span><u>A safer Internet with Cloudflare: free threat intelligence, analytics, and new threat detections</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Free threat intelligence, analytics, new threat detections, and more.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/automatically-generating-cloudflares-terraform-provider/"><span><span><u>Automatically generating Cloudflare’s Terraform provider</u></span></span></a></p>
                        <p> </p>
                    </td>
                    <td>
                        <p><span><span>The last pieces of the OpenAPI schemas ecosystem to now be automatically generated — the Terraform provider and API reference documentation.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/key-transparency/"><span><span><u>Cloudflare helps verify the security of end-to-end encrypted messages by auditing key transparency for WhatsApp</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Cloudflare helps verify the security of end-to-end encrypted messages by auditing key transparency for WhatsApp.</span></span></p>
                    </td>
                </tr>
            </tbody>
        </table>
    </figure>
</div>
    <div>
      <h3>Wednesday</h3>
      <a href="#wednesday">
        
      </a>
    </div>
    <div>
    <figure>
        <table>
            <colgroup>
                <col></col>
                <col></col>
            </colgroup>
            <tbody>
                <tr>
                    <td>
                        <p><span><span>What</span></span></p>
                    </td>
                    <td>
                        <p><span><span>In a sentence…</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/introducing-speed-brain/"><span><span><u>Introducing Speed Brain: helping web pages load 45% faster</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Speed Brain, our latest leap forward in speed, uses the Speculation Rules API to prefetch content for users' likely next navigations — downloading web pages before they navigate to them and making pages load 45% faster.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/instant-purge/"><span><span><u>Instant Purge: invalidating cached content in under 150ms</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Instant Purge invalidates cached content in under 150ms, offering the industry's fastest cache purge with global latency for purges by tags, hostnames, and prefixes.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/new-standards/"><span><span><u>New standards for a faster and more private Internet</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Zstandard compression, Encrypted Client Hello, and more speed and privacy announcements all released for free.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/webrtc-turn-using-anycast/"><span><span><u>TURN and anycast: making peer connections work globally</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Starting today, </span></span><a href="https://developers.cloudflare.com/calls/turn/"><span><span>Cloudflare Calls’ TURN service</span></span></a><span><span> is now generally available to all Cloudflare accounts.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/gen-12-servers"><span><span><u>Cloudflare’s 12th Generation servers — 145% more performant and 63% more efficient</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Next generation servers focused on exceptional performance and security, enhanced support for AI/ML workloads, and significant strides in power efficiency.</span></span></p>
                        <p> </p>
                        <p><span><span> </span></span></p>
                    </td>
                </tr>
            </tbody>
        </table>
    </figure>
</div>
    <div>
      <h3>Thursday</h3>
      <a href="#thursday">
        
      </a>
    </div>
    <div>
    <figure>
        <table>
            <colgroup>
                <col></col>
                <col></col>
            </colgroup>
            <tbody>
                <tr>
                    <td>
                        <p><span><span>What</span></span></p>
                    </td>
                    <td>
                        <p><span><span>In a sentence…</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/startup-program-250k-credits"><span><span><u>Startup Program revamped: build and grow on Cloudflare with up to $250,000 in credits</u></span></span></a></p>
                        <p> </p>
                    </td>
                    <td>
                        <p><span><span>Eligible startups can now apply to receive up to $250,000 in credits to build using Cloudflare's Developer Platform.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/workers-ai-bigger-better-faster"><span><span><u>Cloudflare’s bigger, better, faster AI platform </u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>More powerful GPUs, expanded model support, enhanced logging and evaluations in AI Gateway, and Vectorize GA with larger index sizes and faster queries.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/builder-day-2024-announcements"><span><span><u>Builder Day 2024: 18 big updates to the Workers platform</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Persistent and queryable Workers logs, Node.js compatibility GA, improved Next.js support via OpenNext, built-in CI/CD for Workers, Gradual Deployments, Queues, and R2 Event Notifications GA, and more — making building on Cloudflare easier, faster, and more affordable.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/faster-workers-kv"><span><span><u>Faster Workers KV</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>A deep dive into how we made Workers KV up to 3x faster.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/sqlite-in-durable-objects"><span><span><u>Zero-latency SQLite storage in every Durable Object</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Putting your application code into the storage layer, so your code runs where the data is stored.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/making-workers-ai-faster/"><span><span><u>Making Workers AI faster and more efficient: Performance optimization with KV cache compression and speculative decoding</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Using new optimization techniques such as KV cache compression and speculative decoding, we’ve made large language model (LLM) inference lightning-fast on the Cloudflare Workers AI platform.</span></span></p>
                    </td>
                </tr>
            </tbody>
        </table>
    </figure>
</div>
    <div>
      <h3>Friday</h3>
      <a href="#friday">
        
      </a>
    </div>
    <div>
    <figure>
        <table>
            <colgroup>
                <col></col>
                <col></col>
            </colgroup>
            <tbody>
                <tr>
                    <td>
                        <p><span><span>What</span></span></p>
                    </td>
                    <td>
                        <p><span><span>In a sentence…</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/container-platform-preview"><span><span><u>Our container platform is in production. It has GPUs. Here’s an early look.</u></span></span></a></p>
                        <p> </p>
                    </td>
                    <td>
                        <p><span><span>We’ve been working on something new — a platform for running containers across Cloudflare’s network. We already use it in production, for AI inference and more.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/cisa-pledge-commitment-bug-bounty-vip"><span><span><u>Advancing cybersecurity: Cloudflare implements a new bug bounty VIP program as part of CISA Pledge commitment</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>We implemented a new bug bounty VIP program this year as part of our CISA Pledge commitment.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/launchpad-cohort4-dev-starter-pack/"><span><span><u>Empowering builders: introducing the Dev Alliance and Workers Launchpad Cohort #4</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Get free and discounted access to essential developer tools and meet the latest set of incredible startups building on Cloudflare.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/expanding-our-support-for-oss-projects-with-project-alexandria"><span><span><u>Expanding our support for open source projects with Project Alexandria</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Expanding our open source program and helping projects have a sustainable and scalable future, providing tools and protection needed to thrive.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/radar-data-explorer-ai-assistant"><span><span><u>Network trends and natural language: Cloudflare Radar’s new Data Explorer &amp; AI Assistant</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>A simple Web-based interface to build more complex API queries, including comparisons and filters, and visualize the results.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/bringing-ai-to-cloudflare"><span><span><u>AI Everywhere with the WAF Rule Builder Assistant, Cloudflare Radar AI Insights, and updated AI bot protection</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Extending our AI Assistant capabilities to help you build new WAF rules, added new AI bot and crawler traffic insights to Radar, and new AI bot blocking capabilities.</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><a href="https://blog.cloudflare.com/cloudflares-commitment-to-free"><span><span><u>Reaffirming our commitment to Free</u></span></span></a></p>
                    </td>
                    <td>
                        <p><span><span>Our free plan is here to stay, and we reaffirm that commitment this week with 15 releases that make the Free plan even better.</span></span></p>
                        <p> </p>
                    </td>
                </tr>
            </tbody>
        </table>
    </figure>
</div>
    <div>
      <h2>One more thing…</h2>
      <a href="#one-more-thing">
        
      </a>
    </div>
    
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5FReOqd5AHo8vTgSmY6qe6/1ae02d93ec9d9af2f60c0b6024017f58/image3.png" />
          </figure><p>Cloudflare serves millions of customers and their millions of domains across nearly every country on Earth. However, as a global company, the payment landscape can be complex — especially in regions outside of North America. While credit cards are very popular for online purchases in the US, the global picture is quite different. <a href="https://www.fisglobal.com/-/media/fisglobal/files/campaigns/global-payments%20report/FIS_TheGlobalPaymentsReport_2023.pdf"><u>60% of consumers across EMEA, APAC and LATAM choose alternative payment methods</u></a>. For instance, European consumers often opt for SEPA Direct Debit, a bank transfer mechanism, while Chinese consumers frequently use Alipay, a digital wallet.</p><p>At Cloudflare, we saw this as an opportunity to meet customers where they are. Today, we're thrilled to announce that we are expanding our payment system and launching a closed beta for a new payment method called <a href="https://www.cloudflare.com/lp/cloudflare-introduces-stripe-link/"><u>Stripe Link</u></a>. The checkout experience will be faster and more seamless, allowing our self-serve customers to pay using saved bank accounts or cards with Link. Customers who have saved their payment details at any business using Link can quickly check out without having to reenter their payment information.</p><p>These are the first steps in our efforts to expand our payment system to support global payment methods used by customers around the world.<b> </b>We'll be rolling out new payment methods gradually, ensuring a smooth integration and gathering feedback from our customers every step of the way.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/v0v7QBRWeGSfArq6jE5eg/7d8d79cbfe3f63386db52469c4727d21/image2.png" />
          </figure>
    <div>
      <h2>Until next year</h2>
      <a href="#until-next-year">
        
      </a>
    </div>
    <p>That’s all for Birthday Week 2024. However, the innovation never stops at Cloudflare. Continue to follow the <a href="https://blog.cloudflare.com/"><u>Cloudflare Blog</u></a> all year long as we launch more products and features that help build a better Internet.</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Partners]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[Workers Launchpad]]></category>
            <category><![CDATA[Workers AI]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Turnstile]]></category>
            <category><![CDATA[Performance]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Cache]]></category>
            <category><![CDATA[Speed]]></category>
            <category><![CDATA[Speed Brain]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[AI]]></category>
            <guid isPermaLink="false">65JnLP0MYKVzwTyOsItRJk</guid>
            <dc:creator>Kelly May Johnston</dc:creator>
            <dc:creator>Brendan Irvine-Broque</dc:creator>
        </item>
        <item>
            <title><![CDATA[Our container platform is in production. It has GPUs. Here’s an early look]]></title>
            <link>https://blog.cloudflare.com/container-platform-preview/</link>
            <pubDate>Fri, 27 Sep 2024 13:00:00 GMT</pubDate>
            <description><![CDATA[ We’ve been working on something new — a platform for running containers across Cloudflare’s network. We already use it in production, for AI inference and more. Today we want to share an early look at ]]></description>
            <content:encoded><![CDATA[ <p>We’ve been working on something new — a platform for running containers across Cloudflare’s network. We already use it in production for <a href="https://developers.cloudflare.com/workers-ai/"><u>Workers AI</u></a>, <a href="https://developers.cloudflare.com/workers/ci-cd/"><u>Workers Builds</u></a>, <a href="https://www.cloudflare.com/zero-trust/products/browser-isolation/"><u>Remote Browsing Isolation</u></a>, and the <a href="https://developers.cloudflare.com/browser-rendering/"><u>Browser Rendering API</u></a>. Today, we want to share an early look at how it’s built, why we built it, and how we use it ourselves.</p><p>In 2024, Cloudflare Workers celebrates its 7th birthday. <a href="https://blog.cloudflare.com/introducing-cloudflare-workers/"><u>When we first announced Workers</u></a>, it was a completely new model for running compute in a multi-tenant way — on isolates, as opposed to containers. While, at the time, Workers was a pretty bare-bones functions-as-a-service product, we took a big bet that this was going to become the way software was going to be written going forward. Since introducing Workers, in addition to expanding our developer products in general to include storage and AI, we have been steadily adding more compute capabilities to Workers:</p><table><tr><td><p><b>2020</b></p></td><td><p><a href="https://blog.cloudflare.com/introducing-cron-triggers-for-cloudflare-workers/"><u>Cron Triggers</u></a></p></td></tr><tr><td><p><b>2021</b></p></td><td><p><a href="https://blog.cloudflare.com/durable-objects-easy-fast-correct-choose-three/"><u>Durable Objects</u></a></p><p><a href="https://blog.cloudflare.com/workers-rust-sdk/"><u>Write Workers in Rust</u></a></p><p><a href="https://blog.cloudflare.com/introducing-worker-services/"><u>Service Bindings</u></a></p></td></tr><tr><td><p><b>2022</b></p></td><td><p><a href="https://blog.cloudflare.com/introducing-cloudflare-queues/"><u>Queues</u></a></p><p><a href="https://blog.cloudflare.com/announcing-route-to-workers/"><u>Email Workers</u></a></p><p><a href="https://blog.cloudflare.com/durable-objects-alarms/"><u>Durable Objects Alarms</u></a></p></td></tr><tr><td><p><b>2023</b></p></td><td><p><a href="https://blog.cloudflare.com/workers-tcp-socket-api-connect-databases/"><u>Workers TCP Socket API</u></a> </p><p><a href="https://blog.cloudflare.com/hyperdrive-making-regional-databases-feel-distributed/"><u>Hyperdrive</u></a></p><p><a href="https://blog.cloudflare.com/announcing-workers-smart-placement/"><u>Smart Placement</u></a></p><p><a href="https://blog.cloudflare.com/best-place-region-earth-inference/"><u>Workers AI</u></a></p></td></tr><tr><td><p><b>2024</b></p></td><td><p><a href="https://blog.cloudflare.com/python-workers/"><u>Python Workers</u></a></p><p><a href="https://blog.cloudflare.com/javascript-native-rpc/"><u>JavaScript-native RPC</u></a></p><p><a href="https://blog.cloudflare.com/more-npm-packages-on-cloudflare-workers-combining-polyfills-and-native-code/"><u>Node.js compatibility</u></a></p><p><a href="https://blog.cloudflare.com/sqlite-in-durable-objects"><u>SQLite in Durable Objects</u></a></p></td></tr></table><p>With each of these, we’ve faced a question — can we build this natively into the platform, in a way that removes, rather than adds complexity? Can we build it in a way that lets developers focus on building and shipping, rather than managing infrastructure, so that they don’t have to be a distributed systems engineer to build distributed systems?</p><p>In each instance, the answer has been YES. We try to solve problems in a way that simplifies things for developers in the long run, even if that is the harder path for us to take ourselves. If we didn’t, you’d be right to ask — why not self-host and manage all of this myself? What’s the point of the cloud if I’m still provisioning and managing infrastructure? These are the questions many are asking today about the earlier generation of cloud providers.</p><p>Pushing ourselves to build platform-native products and features helped us answer this question. Particularly because some of these actually use containers behind the scenes, even though as a developer you never interact with or think about containers yourself.</p><p>If you’ve used AI inference on GPUs with <a href="https://developers.cloudflare.com/workers-ai/"><u>Workers AI</u></a>, spun up headless browsers with <a href="https://developers.cloudflare.com/browser-rendering/"><u>Browser Rendering</u></a>, or enqueued build jobs with the new <a href="https://developers.cloudflare.com/workers/ci-cd/"><u>Workers Builds</u></a>, you’ve run containers on our network, without even knowing it. But to do so, we needed to be able to run untrusted code across Cloudflare’s network, outside a <a href="https://developers.cloudflare.com/workers/reference/how-workers-works/#isolates"><u>v8 isolate</u></a>, in a way that fits what we promise:</p><ol><li><p>You shouldn’t have to think about regions or data centers. Routing, scaling, load balancing, scheduling, and capacity are our problem to solve, not yours, with tools like <a href="https://blog.cloudflare.com/announcing-workers-smart-placement/"><u>Smart Placement</u></a>.</p></li><li><p>You should be able to build distributed systems without being a distributed systems engineer.</p></li><li><p>Every millisecond matters — Cloudflare has to be fast.</p></li></ol><p>There wasn’t an off-the-shelf container platform that solved for what we needed, so we built it ourselves — from scheduling to IP address management, pulling and caching images, to improving startup times and more. Our container platform powers many of our newest products, so we wanted to share how we built it, optimized it, and well, you can probably guess what’s next.</p>
    <div>
      <h2>Global scheduling — “The Network is the Computer”</h2>
      <a href="#global-scheduling-the-network-is-the-computer">
        
      </a>
    </div>
    <p>Cloudflare serves the entire world — region: earth. Rather than asking developers to provision resources in specific regions, data centers and availability zones, we think <a href="https://blog.cloudflare.com/the-network-is-the-computer/"><u>“The Network is the Computer”</u></a>. When you build on Cloudflare, you build software that runs on the Internet, not just in a data center.</p><p>When we started working on this, Cloudflare’s architecture was to just run every service via <a href="https://systemd.io/"><u>systemd</u></a> on every server (we call them “metals” — we <a href="https://blog.cloudflare.com/gen-12-servers"><u>run our own hardware</u></a>), allowing all services to take advantage of new capacity we add to our network. That fits running <a href="https://blog.cloudflare.com/upgrading-one-of-the-oldest-components-in-cloudflare-software-stack/"><u>NGINX</u></a> and a few dozen other services, but cannot fit a world where we need to run <i>many thousands</i> of different compute heavy, resource hungry workloads. We’d <a href="https://blog.cloudflare.com/its-crowded-in-here/"><u>run out of space</u></a> just trying to load all of them! Consider a canonical AI workload — deploying <a href="https://blog.cloudflare.com/meta-llama-3-1-available-on-workers-ai/"><u>Llama 3.1 8B</u></a> to an inference server. If we simply ran a Llama 3.1 8B service on every Cloudflare metal, we’d have no flexibility to use GPUs for the <a href="https://developers.cloudflare.com/workers-ai/models/"><u>many other models</u></a> that Workers AI supports.</p><p>We needed something that would allow us to still take advantage of the full capacity of Cloudflare’s entire network, not just the capacity of individual machines. And ideally not put that burden on the developer.</p><p>The answer: we built a control plane on our own Developer Platform that lets us schedule a container anywhere on <a href="https://www.cloudflare.com/en-gb/network/"><u>Cloudflare’s Network</u></a>:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/63nPDnWzVLvx2OB9ZPZXM5/d08be3dd36fbd08bb7205a82b20bf90e/BLOG-2573_2.png" />
          </figure><p>The global scheduler is built on Cloudflare <a href="https://developers.cloudflare.com/workers/"><u>Workers</u></a>, <a href="https://developers.cloudflare.com/durable-objects/"><u>Durable Objects</u></a>, and <a href="https://developers.cloudflare.com/kv/"><u>KV</u></a>, and decides which Cloudflare location to schedule the container to run in. Each location then runs <i>its own</i> scheduler, which decides which metals within that location to schedule the container to run on. Location schedulers monitor compute capacity, and expose this to the global scheduler. This allows Cloudflare to dynamically place workloads based on capacity and hardware availability (e.g. multiple types of GPUs) across our network.</p>
    <div>
      <h2>Why does global scheduling matter?</h2>
      <a href="#why-does-global-scheduling-matter">
        
      </a>
    </div>
    <p>When you run compute on a first generation cloud, the “contract” between the developer and the platform is that the developer must specify what runs where. This is regional scheduling, the status quo.</p><p>Let’s imagine for a second if we applied regional scheduling to running compute on Cloudflare’s network, with locations in <a href="https://www.cloudflare.com/en-gb/network/"><u>330+ cities, across 120+ countries</u></a>. One of the obvious reasons people tell us they want to run on Cloudflare is because we have compute in places where others don’t, within 50ms of 95% of the world’s Internet-connected population. In South America, other clouds have one region in one city. Cloudflare has 19:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/53Ba51lqKDRNQPbEBselC3/0b9cd69b4f9fa29dad355df0076d05b9/BLOG-2573_3.png" />
          </figure><p>Running anywhere means you can be faster, highly available, and have more control over data location. But with regional scheduling, the more locations you run in, the more work you have to do. You configure and manage load balancing, routing, auto-scaling policies and more. Balancing performance and cost in a multi-region setup is literally a full-time job (or more) at most companies who have reached meaningful scale on traditional clouds.</p><p>But most importantly, no matter what tools you bring, you were the one who told the cloud provider, “run this container over here”. The cloud platform can’t move it for you, even if moving it would make your workload faster. This prevents the platform from adding locations, because for each location, it has to convince developers to take action themselves to move their compute workloads to the new location. Each new location carries a risk that developers won’t migrate workloads to it, or migrate too slowly, delaying the return on investment.</p><p>Global scheduling means Cloudflare can add capacity and use it immediately, letting you benefit from it. The “contract” between us and our customers isn’t tied to a specific datacenter or region, so we have permission to move workloads around to benefit customers. This flexibility plays an essential role in all of our own uses of our container platform, starting with GPUs and AI.</p>
    <div>
      <h2>GPUs everywhere: Scheduling large images with Workers AI</h2>
      <a href="#gpus-everywhere-scheduling-large-images-with-workers-ai">
        
      </a>
    </div>
    <p>In late 2023, <a href="https://blog.cloudflare.com/workers-ai/"><u>we launched Workers AI</u></a>, which provides fast, easy to use, and affordable GPU-backed AI inference.</p><p>The more efficiently we can use our capacity, the better pricing we can offer. And the faster we can make changes to which models run in which Cloudflare locations, the closer we can move AI inference to the application, <a href="https://blog.cloudflare.com/making-workers-ai-faster/"><u>lowering Time to First Token (TTFT)</u></a>. This also allows us to be more resilient to spikes in inference requests.</p><p>AI models that rely on GPUs present three challenges though:</p><ol><li><p>Models have different GPU memory needs. GPU memory is the most scarce resource, and different GPUs have different amounts of memory.</p></li><li><p>Not all container runtimes, such as <a href="https://github.com/firecracker-microvm/firecracker/issues/1179"><u>Firecracker</u></a>, support GPU drivers and other dependencies.</p></li><li><p>AI models, particularly LLMs, are very large. Even a smaller parameter model, like <a href="https://developers.cloudflare.com/workers-ai/models/llama-3.1-8b-instruct/"><u>@cf/meta/llama-3.1-8b-instruct</u></a>, is at least 5 GB. The larger the model, the more bytes we need to pull across the network when scheduling a model to run in a new location.</p></li></ol><p>Let’s dive into how we solved each of these…</p><p>First, GPU memory needs. The global scheduler knows which Cloudflare locations have blocks of GPU memory available, and then delegates scheduling the workload on a specific metal to the local scheduler. This allows us to prioritize placement of AI models that use a large amount of GPU memory, and then move smaller models to other machines in the same location. By doing this, we maximize the overall number of locations that we run AI models in, and maximize our efficiency.</p><p>Second, container runtimes and GPU support. Thankfully, from day one we built our container platform to be <i>runtime agnostic</i>. Using <a href="https://blog.cloudflare.com/how-we-use-hashicorp-nomad/"><u>a runtime agnostic scheduler</u></a>, we’re able to support <a href="https://gvisor.dev/"><u>gVisor</u></a>, <a href="https://firecracker-microvm.github.io/"><u>Firecracker</u></a> microVMs, and traditional VMs with <a href="https://www.qemu.org/"><u>QEMU</u></a>. We are also evaluating adding support for another one: <a href="https://github.com/cloud-hypervisor/cloud-hypervisor"><u>cloud-hypervisor</u></a> which is based on <a href="https://github.com/rust-vmm"><u>rust-vmm</u></a> and has a few compelling advantages for our use case:</p><ol><li><p>GPU passthrough <a href="https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/vfio.md"><u>support</u></a> using VFIO</p></li><li><p><a href="https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/device_model.md#vhost-user-net"><u>vhost-user-net</u></a> support, enabling high throughput between the host network interface and the VM</p></li><li><p><a href="https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/device_model.md#vhost-user-net"><u>vhost-user-blk</u></a> support, adding flexibility to introduce novel network-based storage backed by other Cloudflare Workers products</p></li><li><p>all the while being a smaller codebase than QEMU and written in a memory-safe language</p></li></ol><p>Our goal isn’t to build a platform that makes you as the developer choose between runtimes, and ask, “should I use Firecracker or gVisor”. We needed this flexibility in order to be able to run workloads with different needs efficiently, including workloads that depend on GPUs. gVisor has <a href="https://gvisor.dev/docs/user_guide/gpu/"><u>GPU support</u></a>, while Firecracker microVMs currently <a href="https://github.com/firecracker-microvm/firecracker/issues/1179"><u>does not</u></a>.</p><p>gVisor’s main component is an application kernel (called Sentry) that implements a Linux-like interface but is written in a memory-safe language (Go) and runs in userspace. It works by intercepting application system calls and acting as the guest kernel, without the need for translation through virtualized hardware.</p><p>The resource footprint of a containerized application running on gVisor is lower than a VM because it does not require managing virtualized hardware and booting up a kernel instance. However, this comes at the price of reduced application compatibility and higher per-system call overhead.</p><p>To add GPU support, the Google team introduced <a href="https://gvisor.dev/docs/user_guide/gpu/"><u>nvproxy</u></a> which works using the same principles as described above for syscalls: it intercepts <a href="https://en.wikipedia.org/wiki/Ioctl"><u>ioctls</u></a> destined to the GPU and proxies a subset to the GPU kernel module.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1jqt4l5joKUkPNek1xACaM/64df1f3dcab2cae7d9ecf05deb407242/image__19_.png" />
          </figure><p>To solve the third challenge, and make scheduling fast with large models, we weren’t satisfied with the status quo. So we did something about it.</p>
    <div>
      <h2>Docker pull was too slow, so we fixed it (and cut the time in half)</h2>
      <a href="#docker-pull-was-too-slow-so-we-fixed-it-and-cut-the-time-in-half">
        
      </a>
    </div>
    <p>Many of the images we need to run for AI inference are over 15 GB. Specialized inference libraries and GPU drivers add up fast. For example, when we make a scheduling decision to run a fresh container in Tokyo, naively running docker pull to fetch the image from a storage bucket in Los Angeles would be unacceptably slow. And scheduling speed is critical to being able to scale up and down in new locations in response to changes in traffic.</p><p>We had 3 essential requirements:</p><ul><li><p>Pulling and pushing very large images should be fast</p></li><li><p>We should not rely on a single point of failure</p></li><li><p>Our teams shouldn’t waste time managing image registries</p></li></ul><p>We needed globally distributed storage, so we used <a href="https://developers.cloudflare.com/r2/"><u>R2</u></a>. We needed the highest cache hit rate possible, so we used Cloudflare’s <a href="https://developers.cloudflare.com/cache/"><u>Cache</u></a>, and will soon use <a href="https://developers.cloudflare.com/cache/how-to/tiered-cache/"><u>Tiered Cache</u></a>. And we needed a fast container image registry that we could run everywhere, in every Cloudflare location, so we built and open-sourced <a href="https://github.com/cloudflare/serverless-registry"><u>serverless-registry</u></a>, which is built on <a href="https://developers.cloudflare.com/workers/"><u>Workers</u></a>. You can deploy serverless-registry to your own Cloudflare account in about 5 minutes. We rely on it in production.</p><p>This is fast, but we can be faster. Our performance bottleneck was, somewhat surprisingly, <a href="https://docs.docker.com/reference/cli/docker/image/push/"><u>docker push</u></a>. Docker uses <a href="https://www.gzip.org/"><u>gzip</u></a> to compress and decompress layers of images while pushing and pulling. So we started using <a href="https://github.com/facebook/zstd"><u>Zstandard</u></a> (zstd) instead, which compresses and decompresses faster, and results in smaller compressed files.</p><p>In order to build, chunk, and push these images to the R2 registry, we built a custom CLI tool that we use internally in lieu of running docker build and docker push. This makes it easy to use zstd and split layers into 500 MB chunks, which allows uploads to be processed by Workers while staying under <a href="https://developers.cloudflare.com/workers/platform/limits/#request-limits"><u>body size limits</u></a>.</p><p>Using our custom build and push tool doubled the speed of image pulls. Our 30 GB GPU images now pull in 4 minutes instead of 8. We plan on open sourcing this tool in the near future.</p>
    <div>
      <h2>Anycast is the gift that keeps on simplifying — Virtual IPs and the Global State Router</h2>
      <a href="#anycast-is-the-gift-that-keeps-on-simplifying-virtual-ips-and-the-global-state-router">
        
      </a>
    </div>
    <p>We still had another challenge to solve. And yes, we solved it with anycast. We’re Cloudflare, did you expect anything else?</p><p>First, a refresher — Cloudflare operates <a href="https://blog.cloudflare.com/unimog-cloudflares-edge-load-balancer/"><u>Unimog</u></a>, a Layer 4 load balancer that handles all incoming Cloudflare traffic. Cloudflare’s network uses <a href="https://www.cloudflare.com/learning/cdn/glossary/anycast-network"><u>anycast</u></a>, which allows a single IP address to route requests to a variety of different locations. For most Cloudflare services with anycast, the given IP address will route to the nearest Cloudflare data center, reducing latency. Since Cloudflare runs almost every service in every data center, Unimog can simply route traffic to any Cloudflare metal that is online and has capacity, without needing to map traffic to a specific service that runs on specific metals, only in some locations.</p><p>The new compute-heavy, GPU-backed workloads we were taking on forced us to confront this fundamental “everything runs everywhere” assumption. If we run a containerized workflow in 20 Cloudflare locations, how does Unimog know which locations, and which metals, it runs in? You might say “just bring your own <a href="https://developers.cloudflare.com/reference-architecture/architectures/load-balancing/"><u>load balancer</u></a>” — but then what happens when you make scheduling decisions to migrate a workload between locations, scale up, or scale down?</p><p>Anycast is foundational to how we build fast and simple products on our network, and we needed a way to keep building new types of products this way — where a team can <a href="https://www.cloudflare.com/developer-platform/solutions/hosting/">deploy an application</a>, get back a single IP address, and rely on the platform to balance traffic, taking load, container health, and latency into account, without extra configuration. We started letting teams use the container platform without solving this, and it was painfully clear that we needed to do something about it.</p><p>So we started integrating directly into our networking stack, building a sidecar service to Unimog. We’ll call this the Global State Router. Here’s how it works:</p><ul><li><p>An eyeball makes a request to a virtual IP address issued by Cloudflare</p></li><li><p>Request sent to the best location as determined by BGP routing. This is anycast routing.</p></li><li><p>A small <a href="https://ebpf.io/what-is-ebpf/"><u>eBPF</u></a> program sits on the main networking interface and ensures packets bound to a virtual IP address are handled by the Global State Router.</p></li><li><p>The main Global State Router program contains a mapping of all anycast IPs addresses to potential end destination container IP addresses. It updates this mapping based on container health, readiness, distance, and latency. Using this information, it picks a best-fit container.</p></li><li><p>Packets are forwarded at the L4 layer.</p></li><li><p>When a target container’s server receives a packet, its own Global State Router program intercepts the packet and routes it to the local container.</p></li></ul>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/8ZICyfggbTEpkxki0OnYd/13a427a65b1e9d0c5d591468e3f10612/BLOG-2573_5.png" />
          </figure><p>This might sound like just a lower level networking detail, disconnected from developer experience. But by integrating directly with Unimog, we can let developers:</p><ol><li><p>Push a containerized application to Cloudflare.</p></li><li><p>Provide constraints, health checks, and load metrics that describe what the application needs.</p></li><li><p>Delegate scheduling and scaling many containers across Cloudflare’s network.</p></li><li><p>Get back a single IP address that can be used everywhere.</p></li></ol><p>We’re actively working on this, and are excited to continue building on Cloudflare’s anycast capabilities, and pushing to keep the simplicity of running “everywhere” with new categories of workloads.</p>
    <div>
      <h2>Low latency &amp; global — Remote Browser Isolation &amp; Browser Rendering</h2>
      <a href="#low-latency-global-remote-browser-isolation-browser-rendering">
        
      </a>
    </div>
    <p>Our container platform actually started because of a very specific challenge, running <a href="https://www.cloudflare.com/zero-trust/products/browser-isolation/"><u>Remote Browser Isolation</u></a> across our network. Remote Browser Isolation provides Chromium browsers that run on Cloudflare, in containers, rather than on the end user’s own computer. Only the rendered output is sent to the end user. This provides a layer of protection against zero-day browser vulnerabilities, phishing attacks, and ransomware.</p><p>Location is critical — people expect their interactions with a remote browser to feel just as fast as if it ran locally. If the server is thousands of miles away, the remote browser will feel slow. Running across <a href="https://www.cloudflare.com/network/"><u>Cloudflare’s network of over 330 locations</u></a> means the browser is nearly always as close to you as possible.</p><p>Imagine a user in Santiago, Chile, if they were to access a browser running in the same city, each interaction would incur negligible additional latency. Whereas a browser in Buenos Aires might add 21 ms, São Paulo might add 48 ms, Bogota might add 67 ms, and Raleigh, NC might add 128 ms. Where the container runs significantly impacts the latency of every user interaction with the browser, and therefore the experience as a whole.</p><p>It’s not just browser isolation that benefits from running near the user: WebRTC servers stream video better, multiplayer games have less lag, online advertisements can be served faster, financial transactions can be processed faster. Our container platform lets us run anything we need to near the user, no matter where they are in the world.</p>
    <div>
      <h2>Using spare compute — “off-peak” jobs for Workers CI/CD builds</h2>
      <a href="#using-spare-compute-off-peak-jobs-for-workers-ci-cd-builds">
        
      </a>
    </div>
    <p>At any hour of the day, Cloudflare has many CPU cores that sit idle. This is compute power that could be used for something else.</p><p>Via anycast, most of Cloudflare’s traffic is handled as close as possible to the eyeball (person) that requested it. Most of our traffic originates from eyeballs. And the eyeballs of (most) people are closed and asleep between midnight and 5:00 AM local time. While we use our compute capacity very efficiently during the daytime in any part of the world, overnight we have spare cycles. Consider what a map of the world looks like at nighttime in Europe and Africa:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/CtkNFxhvusjLx1khXh9gs/25b5a6579d8abd47bcaa15ba28eddc61/BLOG-2573_6.png" />
          </figure><p>As shown above, we can run containers during “off-peak” in Cloudflare locations receiving low traffic at night. During this time, the CPU utilization of a typical Cloudflare metal looks something like this:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6sXsQ3p19bFecokbR0X1yj/04419589e4f6796fe297435cd1029b5a/Screenshot_2024-09-27_at_2.20.50_PM.png" />
          </figure><p>We have many “background” compute workloads at Cloudflare. These are workloads that don’t actually need to run close to the eyeball because there is no eyeball waiting on the request. The challenge is that many of these workloads require running untrusted code — either a dependency on open-source code that we don’t trust enough to run outside of a sandboxed environment, or untrusted code that customers deploy themselves. And unlike <a href="https://developers.cloudflare.com/workers/configuration/cron-triggers/"><u>Cron Triggers</u></a>, which already make a best-effort attempt to use off-peak compute, these other workloads can’t run in <a href="https://developers.cloudflare.com/workers/reference/how-workers-works/#isolates"><u>v8 isolates</u></a>.</p><p>On Builder Day 2024, we <a href="https://blog.cloudflare.com/builder-day-2024-announcements"><u>announced Workers Builds in open beta</u></a>. You connect your Worker to a git repository, and Cloudflare builds and deploys your Worker each time you merge a pull request. Workers Builds run on our containers platform, using otherwise idle “off-peak” compute, allowing us to offer lower pricing, and hold more capacity for unexpected spikes in traffic in Cloudflare locations during daytime hours when load is highest. We preserve our ability to serve requests as close to the eyeball as possible where it matters, while using the full compute capacity of our network.</p><p>We developed a purpose-built API for these types of jobs. The Workers Builds service has zero knowledge of where Cloudflare has spare compute capacity on its network — it simply schedules an “off-peak” job to run on the containers platform, by defining a scheduling policy:</p><p><code>scheduling_policy: "off-peak"</code></p>
    <div>
      <h2>Making off-peak jobs faster with prewarmed images</h2>
      <a href="#making-off-peak-jobs-faster-with-prewarmed-images">
        
      </a>
    </div>
    <p>Just because a workload isn’t “eyeball-facing” doesn’t mean speed isn’t relevant. When a build job starts, you still want it to start as soon as possible.</p><p>Each new build requires a fresh container though, and we must avoid reusing containers to provide strong isolation between customers. How can we keep build job start times low, while using a new container for each job without over-provisioning? </p><p>We prewarm servers with the proper image. </p><p>Before a server becomes eligible to receive an “off peak” job, the container platform instructs it to download the correct image. Once the image is downloaded and cached locally, new containers can start quickly in a Firecracker VM after receiving a request for a new build. When a build completes, we throw away the container, and start the next build using a fresh container based on the prewarmed image.</p><p>Without prewarming, pulling and unpacking our Workers Build images would take roughly 75 seconds. With prewarming, we’re able to spin up a new container in under 10 seconds. We expect this to get even faster as we introduce optimizations like pre-booting images before new runs, or <a href="https://github.com/firecracker-microvm/firecracker/blob/main/docs/snapshotting/snapshot-support.md"><u>Firecracker snapshotting</u></a>, which can restore a VM in under 200ms.</p>
    <div>
      <h2>Workers and containers, better together</h2>
      <a href="#workers-and-containers-better-together">
        
      </a>
    </div>
    <p>As more of our own engineering teams rely on our containers platform in production, we’ve noticed a pattern: they want a deeper integration with Workers.</p><p>We plan to give it to them. </p><p>Let’s take a look at a project deployed on our container platform already, <a href="https://blog.cloudflare.com/key-transparency/"><u>Key Transparency</u></a>. If the container platform were highly integrated with Workers, what would this team’s experience look like?</p><p>Cloudflare regularly audits changes to public keys used by WhatsApp for encrypting messages between users. Much of the architecture is built on Workers, but there are long-running compute-intensive tasks that are better suited for containers.</p><p>We don’t want our teams to have to jump through hoops to deploy a container and integrate with Workers. They shouldn’t have to pick specific regions to run in, figure out scaling, expose IPs and handle IP updates, or set up Worker-to-container auth.</p><p>We’re still exploring many different ideas and API designs, and we want your feedback. But let’s imagine what it might look like to use Workers, Durable Objects and Containers together.</p><p>In this case, an outer layer of Workers handles most business logic and ingress, a specialized Durable Object is configured to run alongside our new container, and the platform ensures the image is loaded on the right metals and can scale to meet demand.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5GsXRuYvVELJY1syOmfq3z/47d3481116670de291be86438777fbc0/BLOG-2573_8.png" />
          </figure><p>I add a containerized app to the <a href="https://developers.cloudflare.com/workers/wrangler/configuration/"><code><u>wrangler.toml </u></code><u>configuration file</u></a> of my Worker (or <a href="https://blog.cloudflare.com/automatically-generating-cloudflares-terraform-provider"><u>Terraform</u></a>):</p>
            <pre><code>[[container-app]]
image = "./key-transparency/verifier/Dockerfile"
name = "verifier"

[durable_objects]
bindings = { name = "VERIFIER", class_name = "Verifier", container = "verifier" } }
</code></pre>
            <p>Then, in my Worker, I call the runVerification <a href="https://developers.cloudflare.com/workers/runtime-apis/rpc/"><u>RPC method</u></a> of my Durable Object:</p>
            <pre><code>fetch(request, env, ctx) {
  const id = new URL(request.url).searchParams.get('id')
  const durableObjectId = env.VERIFIER.idFromName(request.params.id);
  await env.VERIFIER.get(durableObjectId).runVerification()
  //...
}
</code></pre>
            <p>From my Durable Object I can boot, configure, mount storage buckets as directories, and make HTTP requests to the container:</p>
            <pre><code>class Verifier extends DurableObject {
  constructor(state, env) {
    this.ctx.blockConcurrency(async () =&gt; {

      // starts the container
      await this.ctx.container.start();

      // configures the container before accepting traffic
      const config = await this.state.storage.get("verifierConfig");
      await this.ctx.container.fetch("/set-config", { method: "PUT", body: config});
    })
  }

  async runVerification(updateId) {
    // downloads &amp; mounts latest updates from R2
    const latestPublicKeyUpdates = await this.env.R2.get(`public-key-updates/${updateId}`);
    await this.ctx.container.mount(`/updates/${updateId}`, latestPublicKeyUpdates);

    // starts verification via HTTP call 
    return await this.ctx.container.fetch(`/verifier/${updateId}`);
  }
}
</code></pre>
            <p>And… that’s it.</p><p>I didn’t have to worry about placement, scaling, service discovery authorization, and I was able to leverage integrations into other services like KV and R2 with just a few lines of code. The container platform took care of routing, placement, and auth. If I needed more instances, I could call the binding with a new ID, and the platform would scale up containers for me.</p><p>We are still in the early stages of building these integrations, but we’re excited about everything that containers will bring to Workers and vice versa.</p>
    <div>
      <h2>So, what do you want to build?</h2>
      <a href="#so-what-do-you-want-to-build">
        
      </a>
    </div>
    <p>If you’ve read this far, there’s a non-zero chance you were hoping to get to run a container yourself on our network. While we’re not ready (quite yet) to open up the platform to everyone, now that we’ve built a few GA products on our container platform, we’re looking for a handful of engineering teams to start building, in advance of wider availability in 2025. And we’re <a href="https://job-boards.greenhouse.io/cloudflare/jobs/5547603"><u>continuing to hire engineers</u></a> to work on this.</p><p>We’ve told you about our use cases for containers, and now it’s your turn. If you’re interested, <a href="https://forms.gle/msrkBLBYNFFYRaqY8"><u>tell us here</u></a> what you want to build, and why it goes beyond what’s possible today in <a href="https://developers.cloudflare.com/workers/"><u>Workers</u></a> and on our <a href="https://developers.cloudflare.com/products/?product-group=Developer+platform"><u>Developer Platform</u></a>. What do you wish you could build on Cloudflare, but can’t yet today?</p> ]]></content:encoded>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Durable Objects]]></category>
            <guid isPermaLink="false">5KJejYd85inMDIZUZ6z17D</guid>
            <dc:creator>Brendan Irvine-Broque</dc:creator>
            <dc:creator>Thomas Lefebvre</dc:creator>
            <dc:creator>Mike Nomitch</dc:creator>
        </item>
        <item>
            <title><![CDATA[Leveling up Workers AI: general availability and more new capabilities]]></title>
            <link>https://blog.cloudflare.com/workers-ai-ga-huggingface-loras-python-support/</link>
            <pubDate>Tue, 02 Apr 2024 13:01:00 GMT</pubDate>
            <description><![CDATA[ Today, we’re excited to make a series of announcements, including Workers AI, Cloudflare’s inference platform becoming GA and support for fine-tuned models with LoRAs and one-click deploys from HuggingFace. Cloudflare Workers now supports the Python programming language, and more ]]></description>
            <content:encoded><![CDATA[ <p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1YNXJ4s4e47U7MvddTlpz8/3a53be280a5e373b589eba37bc4740d0/Cities-with-GPUs-momentum-update.png" />
            
            </figure><p>Welcome to Tuesday – our AI day of Developer Week 2024! In this blog post, we’re excited to share an overview of our new AI announcements and vision, including news about Workers AI officially going GA with improved pricing, a GPU hardware momentum update, an expansion of our Hugging Face partnership, Bring Your Own LoRA fine-tuned inference, Python support in Workers, more providers in AI Gateway, and Vectorize metadata filtering.</p>
    <div>
      <h3>Workers AI GA</h3>
      <a href="#workers-ai-ga">
        
      </a>
    </div>
    <p>Today, we’re excited to announce that our Workers AI inference platform is now Generally Available. After months of being in open beta, we’ve improved our service with greater reliability and performance, unveiled pricing, and added many more models to our catalog.</p>
    <div>
      <h4>Improved performance &amp; reliability</h4>
      <a href="#improved-performance-reliability">
        
      </a>
    </div>
    <p>With Workers AI, our goal is to make AI inference as reliable and easy to use as the rest of Cloudflare’s network. Under the hood, we’ve upgraded the load balancing that is built into Workers AI. Requests can now be routed to more GPUs in more cities, and each city is aware of the total available capacity for AI inference. If the request would have to wait in a queue in the current city, it can instead be routed to another location, getting results back to you faster when traffic is high. With this, we’ve increased rate limits across all our models – most LLMs now have a of 300 requests per minute, up from 50 requests per minute during our beta phase. Smaller models have a limit of 1500-3000 requests per minute. Check out our <a href="https://developers.cloudflare.com/workers-ai/platform/limits/">Developer Docs for the rate limits</a> of individual models.</p>
    <div>
      <h4>Lowering costs on popular models</h4>
      <a href="#lowering-costs-on-popular-models">
        
      </a>
    </div>
    <p>Alongside our GA of Workers AI, we published a <a href="https://ai.cloudflare.com/#pricing-calculator">pricing calculator</a> for our 10 non-beta models earlier this month. We want Workers AI to be one of the most affordable and accessible solutions to run <a href="https://www.cloudflare.com/learning/ai/inference-vs-training/">inference</a>, so we added a few optimizations to our models to make them more affordable. Now, Llama 2 is over 7x cheaper and Mistral 7B is over 14x cheaper to run than we had initially <a href="https://developers.cloudflare.com/workers-ai/platform/pricing/">published</a> on March 1. We want to continue to be the best platform for AI inference and will continue to roll out optimizations to our customers when we can.</p><p>As a reminder, our billing for Workers AI started on April 1st for our non-beta models, while beta models remain free and unlimited. We offer 10,000 <a href="/workers-ai#:~:text=may%20be%20wondering%20%E2%80%94-,what%E2%80%99s%20a%20neuron">neurons</a> per day for free to all customers. Workers Free customers will encounter a hard rate limit after 10,000 neurons in 24 hours while Workers Paid customers will incur usage at $0.011 per 1000 additional neurons.  Read our <a href="https://developers.cloudflare.com/workers-ai/platform/pricing/">Workers AI Pricing Developer Docs</a> for the most up-to-date information on pricing.</p>
    <div>
      <h4>New dashboard and playground</h4>
      <a href="#new-dashboard-and-playground">
        
      </a>
    </div>
    <p>Lastly, we’ve revamped our <a href="https://dash.cloudflare.com/?to=/:account/ai/workers-ai">Workers AI dashboard</a> and <a href="https://playground.ai.cloudflare.com/">AI playground</a>. The Workers AI page in the Cloudflare dashboard now shows analytics for usage across models, including neuron calculations to help you better predict pricing. The AI playground lets you quickly test and compare different models and configure prompts and parameters. We hope these new tools help developers start building on Workers AI seamlessly – go try them out!</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3uSiHo9pV21DreFiLpUfPX/5aa5c8a2448da881a0872e3f550c39a2/image3-3.png" />
            
            </figure>
    <div>
      <h3>Run inference on GPUs in over 150 cities around the world</h3>
      <a href="#run-inference-on-gpus-in-over-150-cities-around-the-world">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/qyZ48xVu70u80swQKPUau/1e85ea2b833139d277d5769d5a8c8c66/image5-2.png" />
            
            </figure><p>When we announced Workers AI back in September 2023, we set out to deploy GPUs to our data centers around the world. We plan to deliver on that promise and deploy inference-tuned GPUs almost everywhere by the end of 2024, making us the most widely distributed cloud-AI inference platform. We have over 150 cities with GPUs today and will continue to roll out more throughout the year.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/451IgQCfz2j10xM8kXhZy0/67632b1b5f52e3387aa387e43c804324/image7-1.png" />
            
            </figure><p>We also have our next generation of compute servers with GPUs launching in Q2 2024, which means better performance, power efficiency, and improved reliability over previous generations. We provided a preview of our Gen 12 Compute servers design in a <a href="/cloudflare-gen-12-server-bigger-better-cooler-in-a-2u1n-form-factor">December 2023 blog post</a>, with more details to come. With Gen 12 and future planned hardware launches, the next step is to support larger machine learning models and offer fine-tuning on our platform. This will allow us to achieve higher inference throughput, lower latency and greater availability for production workloads, as well as expanding support to new categories of workloads such as fine-tuning.</p>
    <div>
      <h3>Hugging Face Partnership</h3>
      <a href="#hugging-face-partnership">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7ATIA1mxaeqHYE31cztdjg/33717b0fd20244f3089cf5d4c8a9c13f/image2-2.png" />
            
            </figure><p>We’re also excited to continue our partnership with Hugging Face in the spirit of bringing the best of open-source to our customers. Now, you can visit some of the most popular models on Hugging Face and easily click to run the model on Workers AI if it is available on our platform.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3geQJnlHZhMktG1eoEWYKE/36c76ee43eca9443b4e2e9c6d3e1df7e/image6-1.png" />
            
            </figure><p>We’re happy to announce that we’ve added 4 more models to our platform in conjunction with Hugging Face. You can now access the new <a href="https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2">Mistral 7B v0.2</a> model with improved context windows, <a href="https://huggingface.co/NousResearch/Hermes-2-Pro-Mistral-7B">Nous Research’s Hermes 2 Pro</a> fine-tuned version of Mistral 7B, <a href="https://huggingface.co/google/gemma-7b-it">Google’s Gemma 7B</a>, and <a href="https://huggingface.co/Nexusflow/Starling-LM-7B-beta">Starling-LM-7B-beta</a> fine-tuned from OpenChat. There are currently 14 models that we’ve curated with Hugging Face to be available for serverless GPU inference powered by Cloudflare’s Workers AI platform, with more coming soon. These models are all served using Hugging Face’s technology with a <a href="https://github.com/huggingface/text-generation-inference/">TGI</a> backend, and we work closely with the Hugging Face team to curate, optimize, and deploy these models.</p><blockquote><p><i>“We are excited to work with Cloudflare to make AI more accessible to developers. Offering the most popular open models with a serverless API, powered by a global fleet of GPUs is an amazing proposition for the Hugging Face community, and I can’t wait to see what they build with it.”</i>- <b>Julien Chaumond</b>, Co-founder and CTO, Hugging Face</p></blockquote><p>You can find all of the open models supported in Workers AI in this <a href="https://huggingface.co/collections/Cloudflare/hf-curated-models-available-on-workers-ai-66036e7ad5064318b3e45db6">Hugging Face Collection</a>, and the “Deploy to Cloudflare Workers AI” button is at the top of each model card. To learn more, read Hugging Face’s <a href="http://huggingface.co/blog/cloudflare-workers-ai">blog post</a> and take a look at our <a href="https://developers.cloudflare.com/workers-ai/models/">Developer Docs</a> to get started. Have a model you want to see on Workers AI? Send us a message on <a href="https://discord.cloudflare.com">Discord</a> with your request.</p>
    <div>
      <h3>Supporting fine-tuned inference - BYO LoRAs</h3>
      <a href="#supporting-fine-tuned-inference-byo-loras">
        
      </a>
    </div>
    <p>Fine-tuned inference is one of our most requested features for Workers AI, and we’re one step closer now with Bring Your Own (BYO) LoRAs. Using the popular <a href="https://www.cloudflare.com/learning/ai/what-is-lora/">Low-Rank Adaptation</a> method, researchers have figured out how to take a model and adapt <i>some</i> model parameters to the task at hand, rather than rewriting <i>all</i> model parameters like you would for a fully fine-tuned model. This means that you can get fine-tuned model outputs without the computational expense of fully fine-tuning a model.</p><p>We now support bringing trained LoRAs to Workers AI, where we apply the LoRA adapter to a base model at runtime to give you fine-tuned inference, at a fraction of the cost, size, and speed of a fully fine-tuned model. In the future, we want to be able to support fine-tuning jobs and fully fine-tuned models directly on our platform, but we’re excited to be one step closer today with LoRAs.</p>
            <pre><code>const response = await ai.run(
  "@cf/mistralai/mistral-7b-instruct-v0.2-lora", //the model supporting LoRAs
  {
      messages: [{"role": "user", "content": "Hello world"],
      raw: true, //skip applying the default chat template
      lora: "00000000-0000-0000-0000-000000000", //the finetune id OR name 
  }
);</code></pre>
            <p>BYO LoRAs is in open beta as of today for Gemma 2B and 7B, Llama 2 7B and Mistral 7B models with LoRA adapters up to 100MB in size and max rank of 8, and up to 30 total LoRAs per account. As always, we expect you to use Workers AI and our new BYO LoRA feature with our <a href="https://www.cloudflare.com/service-specific-terms-developer-platform/#developer-platform-terms">Terms of Service</a> in mind, including any model-specific restrictions on use contained in the models’ license terms.</p><p>Read the technical deep dive blog post on <a href="/fine-tuned-inference-with-loras">fine-tuning with LoRA</a> and <a href="https://developers.cloudflare.com/workers-ai/fine-tunes">developer docs</a> to get started.</p>
    <div>
      <h3>Write Workers in Python</h3>
      <a href="#write-workers-in-python">
        
      </a>
    </div>
    <p>Python is the second most popular programming language in the world (after JavaScript) and the language of choice for building AI applications. And starting today, in open beta, you can now <a href="https://ggu-python.cloudflare-docs-7ou.pages.dev/workers/languages/python/">write Cloudflare Workers in Python</a>. Python Workers support all <a href="https://developers.cloudflare.com/workers/configuration/bindings/">bindings</a> to resources on Cloudflare, including <a href="https://developers.cloudflare.com/vectorize/">Vectorize</a>, <a href="https://developers.cloudflare.com/d1/">D1</a>, <a href="https://developers.cloudflare.com/kv/">KV</a>, <a href="https://www.cloudflare.com/developer-platform/products/r2/">R2</a> and more.</p><p><a href="https://ggu-python.cloudflare-docs-7ou.pages.dev/workers/languages/python/packages/langchain/">LangChain</a> is the most popular framework for building LLM‑powered applications, and like how <a href="/langchain-and-cloudflare">Workers AI works with langchain-js</a>, the <a href="https://python.langchain.com/docs/get_started/introduction">Python LangChain library</a> works on Python Workers, as do <a href="https://ggu-python.cloudflare-docs-7ou.pages.dev/workers/languages/python/packages/">other Python packages</a> like FastAPI.</p><p>Workers written in Python are just as simple as Workers written in JavaScript:</p>
            <pre><code>from js import Response

async def on_fetch(request, env):
    return Response.new("Hello world!")</code></pre>
            <p>…and are configured by simply pointing at a .py file in your <code>wrangler.toml</code>:</p>
            <pre><code>name = "hello-world-python-worker"
main = "src/entry.py"
compatibility_date = "2024-03-18"
compatibility_flags = ["python_workers"]</code></pre>
            <p>There are no extra toolchain or precompilation steps needed. The <a href="https://pyodide.org/en/stable/">Pyodide</a> Python execution environment is provided for you, directly by the Workers runtime, mirroring how Workers written in JavaScript already work.</p><p>There’s lots more to dive into — take a look at the <a href="https://ggu-python.cloudflare-docs-7ou.pages.dev/workers/languages/python/">docs</a>, and check out our <a href="/python-workers">companion blog post</a> for details about how Python Workers work behind the scenes.</p>
    <div>
      <h2>AI Gateway now supports Anthropic, Azure, AWS Bedrock, Google Vertex, and Perplexity</h2>
      <a href="#ai-gateway-now-supports-anthropic-azure-aws-bedrock-google-vertex-and-perplexity">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6YaNMed9Aw4YjhbZk75SGI/a53b499b743e36ad2635357118e6623f/image4-2.png" />
            
            </figure><p>Our <a href="/announcing-ai-gateway">AI Gateway</a> product helps developers better control and observe their AI applications, with analytics, caching, rate limiting, and more. We are continuing to add more providers to the product, including Anthropic, Google Vertex, and Perplexity, which we’re excited to announce today. We quietly rolled out Azure and Amazon Bedrock support in December 2023, which means that the most popular providers are now supported via AI Gateway, including Workers AI itself.</p><p>Take a look at our <a href="https://developers.cloudflare.com/ai-gateway/">Developer Docs</a> to get started with AI Gateway.</p>
    <div>
      <h4>Coming soon: Persistent Logs</h4>
      <a href="#coming-soon-persistent-logs">
        
      </a>
    </div>
    <p>In Q2 of 2024, we will be adding persistent logs so that you can push your logs (including prompts and responses) to <a href="https://www.cloudflare.com/learning/cloud/what-is-object-storage/">object storage</a>, custom metadata so that you can tag requests with user IDs or other identifiers, and secrets management so that you can securely manage your application’s API keys.</p><p>We want AI Gateway to be the control plane for your AI applications, allowing developers to dynamically evaluate and route requests to different models and providers. With our persistent logs feature, we want to enable developers to use their logged data to fine-tune models in one click, eventually running the fine-tune job and the fine-tuned model directly on our Workers AI platform. AI Gateway is just one product in our AI toolkit, but we’re excited about the workflows and use cases it can unlock for developers building on our platform, and we hope you’re excited about it too.</p>
    <div>
      <h3>Vectorize metadata filtering and future GA of million vector indexes</h3>
      <a href="#vectorize-metadata-filtering-and-future-ga-of-million-vector-indexes">
        
      </a>
    </div>
    <p>Vectorize is another component of our toolkit for AI applications. In open beta since September 2023, Vectorize allows developers to persist embeddings (vectors), like those generated from Workers AI <a href="https://developers.cloudflare.com/workers-ai/models/#text-embeddings">text embedding</a> models, and query for the closest match to support use cases like similarity search or recommendations. Without a vector database, model output is forgotten and can’t be recalled without extra costs to re-run a model.</p><p>Since Vectorize’s open beta, we’ve added <a href="https://developers.cloudflare.com/vectorize/reference/metadata-filtering/">metadata filtering</a>. Metadata filtering lets developers combine vector search with filtering for arbitrary metadata, supporting the query complexity in AI applications. We’re laser-focused on getting Vectorize ready for general availability, with an target launch date of June 2024, which will include support for multi-million vector indexes.</p>
            <pre><code>// Insert vectors with metadata
const vectors: Array&lt;VectorizeVector&gt; = [
  {
    id: "1",
    values: [32.4, 74.1, 3.2],
    metadata: { url: "/products/sku/13913913", streaming_platform: "netflix" }
  },
  {
    id: "2",
    values: [15.1, 19.2, 15.8],
    metadata: { url: "/products/sku/10148191", streaming_platform: "hbo" }
  },
...
];
let upserted = await env.YOUR_INDEX.upsert(vectors);

// Query with metadata filtering
let metadataMatches = await env.YOUR_INDEX.query(&lt;queryVector&gt;, { filter: { streaming_platform: "netflix" }} )</code></pre>
            
    <div>
      <h3>The most comprehensive Developer Platform to build AI applications</h3>
      <a href="#the-most-comprehensive-developer-platform-to-build-ai-applications">
        
      </a>
    </div>
    <p>On Cloudflare’s Developer Platform, we believe that all developers should be able to quickly build and ship full-stack applications  – and that includes AI experiences as well. With our GA of Workers AI, announcements for Python support in Workers, AI Gateway, and Vectorize, and our partnership with Hugging Face, we’ve expanded the world of possibilities for what you can build with AI on our platform. We hope you are as excited as we are – take a look at all our <a href="https://developers.cloudflare.com">Developer Docs</a> to get started, and <a href="https://discord.cloudflare.com/">let us know</a> what you build.</p> ]]></content:encoded>
            <category><![CDATA[Developer Week]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Workers AI]]></category>
            <category><![CDATA[General Availability]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <guid isPermaLink="false">6ItPe1u2j71C4DTSxJdccB</guid>
            <dc:creator>Michelle Chen</dc:creator>
            <dc:creator>Jesse Kipp</dc:creator>
            <dc:creator>Syona Sarma</dc:creator>
            <dc:creator>Brendan Irvine-Broque</dc:creator>
            <dc:creator>Vy Ton</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare named a leader in Forrester Edge Development Platforms Wave, Q4 2023]]></title>
            <link>https://blog.cloudflare.com/forrester-wave-edge-development-2023/</link>
            <pubDate>Mon, 27 Nov 2023 18:08:50 GMT</pubDate>
            <description><![CDATA[ Forrester has recognized Cloudflare as a leader in The Forrester Wave™: Edge Development Platforms, Q4 2023 with the top score in the current offering category ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Forrester has recognized Cloudflare as a leader in The Forrester Wave™: Edge Development Platforms, Q4 2023 with the top score in the current offering category.</p><p>According to <a href="http://www.cloudflare.com/lp/forrester-wave-edge-development-q4-2023/">the report</a> by Principal Analyst, Devin Dickerson, “Cloudflare’s edge development platform provides the building blocks enterprises need to create full stack distributed applications and enables developers to take advantage of a globally distributed network of compute, storage and programmable security without being experts on CAP theorem.“</p><p>Over one million developers are building applications using the Developer Platform products including <a href="https://workers.cloudflare.com/">Workers</a>, <a href="https://pages.cloudflare.com/">Pages</a>, <a href="https://developers.cloudflare.com/r2/">R2</a>, <a href="https://developers.cloudflare.com/kv/">KV</a>, <a href="https://developers.cloudflare.com/queues/">Queues</a>, <a href="https://developers.cloudflare.com/durable-objects/">Durable Objects</a>, <a href="https://developers.cloudflare.com/d1/">D1</a>, <a href="https://developers.cloudflare.com/stream/">Stream</a>, <a href="https://developers.cloudflare.com/images/">Images</a>, and more. Developers can easily deploy highly distributed, full-stack applications using Cloudflare’s full suite of compute, storage, and developer services.</p>
    <div>
      <h3>Workers make Cloudflare’s network programmable</h3>
      <a href="#workers-make-cloudflares-network-programmable">
        
      </a>
    </div>
    <blockquote><p><b><i>“ A key strength of the platform is the interoperability with Cloudflare’s programmable global CDN combined with a deployment model that leverages intelligent workload placement.”–</i></b> <b>The Forrester Wave™: Edge Development Platforms, Q4 2023</b></p></blockquote><p>Workers run across <a href="https://www.cloudflare.com/network/">Cloudflare’s global network</a>, provide <a href="https://developers.cloudflare.com/workers/runtime-apis/cache/">APIs</a> to read from and write directly to the local cache, and expose context from Cloudflare’s CDN directly on the <a href="https://developers.cloudflare.com/workers/runtime-apis/request/#incomingrequestcfproperties">request object</a> that a Worker receives.</p><p>This close integration with Cloudflare’s network allows developers to build, protect, and connect globally distributed applications, without deploying to specific regions. <a href="https://developers.cloudflare.com/workers/configuration/smart-placement/">Smart Placement</a> optimizes Workers to run in the location that yields the fastest overall performance, whether it's the location closest to the data, or closest to the user. <a href="https://developers.cloudflare.com/hyperdrive/learning/how-hyperdrive-works/">Hyperdrive</a> automatically pools database connections, allowing Workers running all over the world to reuse them when querying PostgreSQL databases, avoiding the scaling challenges that make it hard to use traditional databases with a serverless architecture. <a href="https://developers.cloudflare.com/workers/configuration/cron-triggers/">Cron Triggers</a> allow for up to 15 minutes of CPU time, allowing for compute intensive background work.</p><p>Cloudflare is beyond edge computing — it’s everywhere computing. We use our network to make your application perform best, shaped by real-world data and tailored to access patterns and programming paradigms.</p>
    <div>
      <h3>Deploy distributed systems, without being a distributed systems expert</h3>
      <a href="#deploy-distributed-systems-without-being-a-distributed-systems-expert">
        
      </a>
    </div>
    <blockquote><p><b><i>“ Reference customers consistently call out the ease of onboarding, which sees developers with no prior background delivering workloads across the globe in minutes, and production quality applications within a week. “–</i></b> <b>The Forrester Wave™: Edge Development Platforms, Q4 2023</b></p></blockquote><p>Workers empower any developer to deploy globally distributed applications, without needing to become distributed systems experts or experts in configuring cloud infrastructure.</p><ul><li><p>When you deploy a Worker, behind the scenes Cloudflare distributes it across the globe. But to you, it’s a single application that you can <a href="https://developers.cloudflare.com/workers/observability/local-development-and-testing/">run and test locally</a>, using the same <a href="https://github.com/cloudflare/workerd">open-source JavaScript runtime</a> that your Workers run on in production.</p></li><li><p>When you deploy a <a href="https://developers.cloudflare.com/durable-objects/">Durable Object</a> to coordinate real-time state, you’ve built a distributed application, but instead of having to learn RPC protocols and scale infrastructure, you’ve programmed the whole thing in JavaScript using web standard APIs that front-end developers know and rely on daily.</p></li><li><p>Enqueuing and processing batches of messages with <a href="https://developers.cloudflare.com/queues/">Cloudflare Queues</a> takes adding just a few more lines of JavaScript to an existing Worker.</p></li><li><p>When you create a web application with <a href="https://pages.cloudflare.com/">Cloudflare Pages</a>, you’ve set up a complete continuous build and deployment pipeline with preview URLs, just by connecting to a GitHub repository.</p></li></ul><p>Developers who previously only wrote front-end code are able to build the back end, and make their app real-time and reactive. Teams stuck waiting for infrastructure experts to provision resources are able to start prototyping today rather than next week. Writing and deploying a Worker is familiar and accessible, and this lets engineering teams move faster, with less overhead.</p><p>Why are teams able to get started so quickly?</p><ol><li><p>Workers use <a href="https://developers.cloudflare.com/workers/runtime-apis/">web standard APIs</a> that front-end developers and anyone building web applications already use every day. Cloudflare was a founding member of the Web-interoperable Runtimes Community Group (<a href="https://wintercg.org/">WinterCG</a>) and is committed to <a href="/socket-api-works-javascript-runtimes-wintercg-polyfill-connect/">interoperability across runtimes</a>.</p></li><li><p>The tools developers already use every day are native to our platform. We publish <a href="https://www.npmjs.com/package/@cloudflare/workers-types">TypeScript</a> types for all APIs, and support compiling TypeScript when authoring and deploying via the Wrangler CLI or via the code editor in the Cloudflare dashboard — which itself is <a href="/improved-quick-edit/">powered by</a> the popular VSCode editor.</p></li><li><p>The open-source <a href="https://developers.cloudflare.com/pages/framework-guides/">frameworks</a> that developers prefer to build with are supported. A growing set of APIs from Node.js are <a href="https://developers.cloudflare.com/workers/runtime-apis/nodejs/">available natively</a> in the Workers runtime, allowing existing open source libraries to work on Workers. And increasingly, new open source projects that developers depend on are designed from day one to work across all WinterCG runtimes. Every day, more of the JavaScript ecosystem works on Workers.</p></li></ol>
    <div>
      <h3>Expanding into AI with GPUs, LLMs, and more</h3>
      <a href="#expanding-into-ai-with-gpus-llms-and-more">
        
      </a>
    </div>
    <blockquote><p><b><i>“Its superior vision refuses to limit the future footprint to the edge, and their purposeful approach to building out capabilities on the roadmap suggests that it will be increasingly well positioned to take on public cloud hyperscalers for workloads. “–</i></b> <b>The Forrester Wave™: Edge Development Platforms, Q4 2023</b></p></blockquote><p>We are building a complete compute platform for production applications at scale. And as every company and every developer is now building or experimenting with AI, Cloudflare has <a href="/workers-ai">made GPUs an integrated part of our developer platform</a>. We’ve made it just as easy to get started with AI as we have to deliver a global workload. In mid-November, we hit our goal to have Workers AI Inference running in <a href="/workers-ai-update-stable-diffusion-code-llama-workers-ai-in-100-cities/">over 100 cities</a> around the world, and by the end of the 2024 Workers AI will be running in nearly every city Cloudflare has a presence in.</p><p><a href="https://developers.cloudflare.com/workers-ai/">Workers AI</a> allows developers to build applications using the latest open-source AI models, without provisioning any infrastructure or paying for costly unused capacity. We’re extending this to support <a href="/partnering-with-hugging-face-deploying-ai-easier-affordable/">deploying models directly from Hugging Face to Workers AI</a>, for an even wider set of AI models. And unlike provisioning a VM with a GPU in a specific data center, we’re building this such that we can treat our whole network as one giant compute resource, running models in the right place at the right time to serve developers’ needs.</p><p>Beyond model inference, we’re doubling down on supporting web standard APIs and making the <a href="/webgpu-in-workers/">WebGPU</a> API available from within the Workers platform. While we’re proud to be recognized as a leading edge platform, we’re not just that —we are a platform for developing full-stack applications, even those that require compute power that just one year ago very few used or needed.</p><p>We’re excited to show you what’s next, including <a href="/secrets-store/">a new way to manage secrets</a> across Cloudflare products, improved observability, and better tools for releasing changes. Every day we see more advanced applications built on our platform, and we’re committed to matching that with tools to serve the most mission-critical workloads — the same ones we use ourselves to build our products on our own platform.</p><p>Download the report <a href="http://www.cloudflare.com/lp/forrester-wave-edge-development-q4-2023/">here</a>.</p> ]]></content:encoded>
            <category><![CDATA[Forrester]]></category>
            <guid isPermaLink="false">5KWOonIRXhvPbMK2rGbYyW</guid>
            <dc:creator>Brendan Irvine-Broque</dc:creator>
            <dc:creator>Dawn Parzych</dc:creator>
        </item>
        <item>
            <title><![CDATA[New Workers pricing — never pay to wait on I/O again]]></title>
            <link>https://blog.cloudflare.com/workers-pricing-scale-to-zero/</link>
            <pubDate>Thu, 28 Sep 2023 13:00:03 GMT</pubDate>
            <description><![CDATA[ Announcing new pricing for Cloudflare Workers, where you are billed based on CPU time, and never for the idle time that your Worker spends waiting on network requests and other I/O. ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1pAdu3xHWDEFZwNaAD27Cj/9de34b95a0b4e062edd6673b810d02aa/image4-15.png" />
            
            </figure><p>Today we are announcing new pricing for <a href="https://developers.cloudflare.com/workers/">Cloudflare Workers</a> and <a href="https://developers.cloudflare.com/pages/platform/functions/get-started/">Pages Functions</a>, where you are billed based on CPU time, and never for the idle time that your Worker spends waiting on network requests and other I/O. Unlike other platforms, when you build applications on Workers, you only pay for the compute resources you actually use.</p><p>Why is this exciting? To date, all large serverless compute platforms have billed based on how long your function runs — its duration or “wall time”. This is a reflection of a new paradigm built on a leaky abstraction — your code may be neatly packaged up into a “function”, but under the hood there’s a <a href="https://www.cloudflare.com/learning/cloud/what-is-a-virtual-machine/">virtual machine (VM)</a>. A VM can’t be paused and resumed quickly enough to execute another piece of code while it waits on I/O. So while a typical function might take 100ms to run, it might typically spend only 10ms doing CPU work, like crunching numbers or parsing JSON, with the rest of time spent waiting on I/O.</p><p><b>This status quo has meant that you are billed for this idle time, while nothing is happening.</b></p><p>With this announcement, Cloudflare is the first and only global serverless platform to offer standard pricing based on CPU time, rather than duration. We think you should only pay for the compute time you actually use, and that’s how we’re going to bill you going forward.</p>
    <div>
      <h3>Old pricing — two pricing models, each with tradeoffs</h3>
      <a href="#old-pricing-two-pricing-models-each-with-tradeoffs">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6x9m1087glgizKpAMBJFW5/4882c9dc0081ca2de6cb3468968ea491/Screenshot-2023-09-25-at-4.45.08-PM.png" />
            
            </figure>
    <div>
      <h3>New pricing — one simple and predictable pricing model</h3>
      <a href="#new-pricing-one-simple-and-predictable-pricing-model">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/25bav4xJzPGs970MMWrWOc/10970d02057b8f0181303482ad2f4e5b/Screenshot-2023-09-25-at-4.56.25-PM.png" />
            
            </figure>
    <div>
      <h3>With the same generous Free plan</h3>
      <a href="#with-the-same-generous-free-plan">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5cqN9JRJhjbfRjU3VU4Dl3/aa68ec49b181b29fdcbb978298abfa57/Screenshot-2023-09-25-at-4.59.55-PM.png" />
            
            </figure><p>Unlike wall time (duration, or GB-s), CPU time is more predictable and under your control. When you make a request to a third party API, you can’t control how long that API takes to return a response. This time can be quite long, and vary dramatically — particularly when building <a href="https://www.cloudflare.com/learning/ai/what-is-artificial-intelligence/">AI</a> applications that make inference requests to LLMs. If a request takes twice as long to complete, duration-based billing means you pay double. By contrast, CPU time is consistent and unaffected by time spent waiting on I/O — purely a function of the logic and processing of inputs on outputs to your Worker. It is entirely under your control.</p><p>Starting October 31, 2023, you will have the option to opt in individual <a href="https://developers.cloudflare.com/workers/">Workers</a> and <a href="https://developers.cloudflare.com/pages/platform/functions/">Pages Functions</a> projects on your account to new pricing, and newly created projects will default to new pricing. You’ll be able to estimate how much new pricing will cost in the Cloudflare dashboard. For the majority of current applications, new pricing is the same or less expensive than the previous Bundled and Unbound pricing plans.</p><p>If you’re on our Workers Paid plan, you will have until March 1, 2024 to switch to the new pricing on your own, after which all of your projects will be automatically migrated to new pricing. If you’re an Enterprise customer, any contract renewals after March 1, 2024, will use the new pricing. You’ll receive plenty of advance notice via email and dashboard notifications before any changes go into effect. And since CPU time is fully in your control, the more you optimize your Worker’s compute time, the less you’ll pay. Your incentives are aligned with ours, to make efficient use of compute resources on Region: Earth.</p>
    <div>
      <h2>The challenge of truly scaling to zero</h2>
      <a href="#the-challenge-of-truly-scaling-to-zero">
        
      </a>
    </div>
    <p>The beauty of serverless is that it allows teams to focus on what matters most — delivering value to their customers, rather than managing infrastructure. It saves you money by effortlessly scaling up and down all over the world based on your traffic, whether you’re an early stage startup or <a href="https://www.cloudflare.com/case-studies/shopify/">Shopify during Black Friday</a>.</p><p>One of the promises of serverless is the idea of scaling to zero — once those big days subside, you no longer have to pay for virtual machines to sit idle before your autoscaling kicks in, or be charged by the hour for instances that you barely ended up using. No compute = no bills for usage. Or so, at least, is the promise of serverless.</p><p>Yet, there’s one hidden cost, where even in the serverless world you will find yourself paying for idle resources — what happens when your function is sitting around waiting on I/O? With pricing based on the duration that a function runs, you’re still billed for time that your service is doing zero work, and just waiting on network requests.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2miAVPZ7it2rhk06NCCNPH/292b6712868fbae8e1050776e751a3ac/image3-20.png" />
            
            </figure><p>Most applications spend far more time waiting on this I/O than they do using the CPU, often <i>ten times more</i>.</p><p>Imagine a similar scenario in your own life — you grab a cab to go to the airport. On the way, the driver decides to stop to refuel and grab a snack, but leaves the meter running. This is not time spent bringing you closer to your destination, but it’s time that you’re paying for. Now imagine for the time the driver was refueling the car, the meter was paused. That’s the difference between CPU time and duration, or wall clock time.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4H873Xpqrx3Qpgd7Oe9CNm/2839487c6dd05a2d3af596ba40e113b0/image1-13.png" />
            
            </figure><p>But rather than waiting on the driver to refuel or grab a Snickers bar, what is it that you’re actually paying for when it comes to serverless compute?</p><p><b>Time spent waiting on services you don’t control</b></p><p>Most applications depend on one or many external service providers. Providers of hosted <a href="https://www.cloudflare.com/learning/ai/what-is-large-language-model/">large language models (LLMs)</a> like GPT-4 or Stable Diffusion. Databases as a service. Payment processors. Or simply an API request to a system outside your control. This is where software development is headed — rather than reinventing the wheel and slowly building everything themselves, both fast-moving startups and the Fortune 500 increasingly build using other services to avoid undifferentiated heavy lifting.</p><p>Every time an application interacts with one of these external services, it has to send data over the network and wait until it receives a response. And while some services are lightning fast, others can take considerable time, like waiting for a payment processor or for a large media file to be uploaded or converted. Your own application sits idle for most of the request, waiting on services outside your control.</p><p>Until today, you’ve had to pay while your application waits. You’ve had to pay more when a service you depend on has an operational issue and slows down, or times out in responding to your request. This has been a disincentive to incrementally move parts of your application to serverless.</p>
    <div>
      <h3>Cloudflare’s new pricing: the first serverless platform to truly scale down to zero</h3>
      <a href="#cloudflares-new-pricing-the-first-serverless-platform-to-truly-scale-down-to-zero">
        
      </a>
    </div>
    <p>The idea of “scale to zero” is that you never have to keep instances of your application sitting idle, waiting for something to happen. <a href="https://www.cloudflare.com/learning/serverless/what-is-serverless/">Serverless</a> is more than just not having to manage servers or virtual machines — you shouldn’t have to provision and manage the number of compute resources that are available or warm.</p><p>Our new pricing takes the “scale to zero” concept even further, and extends it to whether your application is actually performing work. If you’re still paying while nothing is happening, we don’t think that’s truly scale to zero. Your application is idle. The CPU can be used for other tasks. Whether your application is “running” is an old concept lifted from an era before multi-tenant cloud platforms. What matters is if you are actually using compute resources.</p>
    <div>
      <h2>Pay less, deploy everywhere, without hidden costs</h2>
      <a href="#pay-less-deploy-everywhere-without-hidden-costs">
        
      </a>
    </div>
    <p>Let’s compare what you’d pay on new Workers pricing to AWS Lambda, for the following Worker:</p><ul><li><p>One billion requests per month</p></li><li><p>Seven CPU milliseconds per request</p></li><li><p>200ms duration per request</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/65SnJPMC26Y0joJF76EJk8/b006ba6aa7a587c76ec6b6bb329fed39/Screenshot-2023-09-25-at-5.16.25-PM.png" />
            
            </figure><p><i>The above table is for informational purposes only. Prices are limited to the public fees as of September 20, 2023, and do not include taxes and any other fees. AWS Lambda and Lambda @ Edge prices are based on publicly available pricing in US-East (Ohio) region as published on </i><a href="https://aws.amazon.com/lambda/pricing/"><i>https://aws.amazon.com/lambda/pricing/</i></a></p><p>Workers are the most cost-effective option, and are <a href="https://www.cloudflare.com/network/">globally distributed</a>, automatically optimized with <a href="https://developers.cloudflare.com/workers/configuration/smart-placement/">Smart Placement</a>, and integrated with <a href="https://developers.cloudflare.com/durable-objects/">Durable Objects</a>, <a href="https://developers.cloudflare.com/r2/">R2</a>, <a href="https://developers.cloudflare.com/workers/learning/how-kv-works/">KV</a>, <a href="https://developers.cloudflare.com/workers/runtime-apis/cache/">Cache</a>, <a href="https://developers.cloudflare.com/queues/">Queues</a>, <a href="https://developers.cloudflare.com/d1/">D1</a> and <a href="https://developers.cloudflare.com/workers/configuration/bindings/">more</a>. And with Workers, you never have to pay extra for provisioned concurrency, pay a penalty for streaming responses, or incur <a href="/aws-egregious-egress/">egregious egress fees</a>.</p>
    <div>
      <h3>New Workers pricing makes building AI applications dramatically cheaper</h3>
      <a href="#new-workers-pricing-makes-building-ai-applications-dramatically-cheaper">
        
      </a>
    </div>
    <p>Yesterday we announced a new suite of products to let you build AI applications on Cloudflare — <a href="/best-place-region-earth-inference/">Workers AI</a>, <a href="/announcing-ai-gateway/">AI Gateway</a>, and our new <a href="https://www.cloudflare.com/learning/ai/what-is-vector-database/">vector database</a>, <a href="/vectorize-vector-database-open-beta">Vectorize</a>.</p><p>Nearly everyone is building new products and features using AI models right now. Large language models and <a href="https://www.cloudflare.com/learning/ai/what-is-generative-ai/">generative AI models</a> are incredibly powerful. But they aren’t always fast — asking a model to create an image, transcribe a segment of audio, or write a story often takes multiple seconds — far longer than a typical API response or database query that we expect to return in tens of milliseconds. There is significant compute work going on behind the scenes, and that means longer duration per request to a Worker.</p><p>New Workers pricing makes this much less expensive than it was previously on the Unbound usage model.</p><p>Let’s take the same example as above, but instead assume the duration of the request is two seconds (2000ms), because the Worker makes an inference request to a large AI model. With new Workers pricing, you pay the exact same amount, no matter how long this request takes.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4WzUKUySJqFN7VU3adRMjq/47f5bff96075cda23fe6ce0456e79611/Screenshot-2023-09-25-at-5.23.27-PM.png" />
            
            </figure>
    <div>
      <h3>No surprise bills — set a maximum limit on CPU time for each Worker</h3>
      <a href="#no-surprise-bills-set-a-maximum-limit-on-cpu-time-for-each-worker">
        
      </a>
    </div>
    <p>Surprise bills from cloud providers are an unfortunately common horror story. In the old way of provisioning compute resources, forgetting to shut down an instance of a database or virtual machine can cost hundreds of dollars. And accidentally autoscaling up too high can be even worse.</p><p>We’re building new safeguards to prevent these kinds of scenarios on Workers. As part of new pricing, you will be able to cap CPU usage on a per-Worker basis.</p><p>For example, if you have a Worker with a p99 CPU time of 15ms, you might use this to set a max CPU limit of 40ms — enough headroom to ensure that your worker will run successfully, while ensuring that even if you ship a bug that causes a CPU time to ratchet up dramatically, or have an edge case that causes infinite recursion, you can’t suddenly rack up a giant unexpected bill, or be vulnerable to a denial of wallet attack. This can be particularly helpful if your worker handles variable or user-generated input, to guard against edge cases that you haven’t accounted for.</p><p>Alternatively, if you’re running a production service, but want to make sure you stay on top of your costs, we will also be adding the option to configure <a href="https://developers.cloudflare.com/fundamentals/notifications/">notifications</a> that can automatically email you, page you, or send a webhook if your worker exceeds a particular amount of CPU time per request. You will be able to choose at what threshold you want to be notified, and how.</p>
    <div>
      <h3>New ways to “hibernate” Durable Objects while keeping connections alive</h3>
      <a href="#new-ways-to-hibernate-durable-objects-while-keeping-connections-alive">
        
      </a>
    </div>
    <p>While Workers are stateless functions, <a href="https://developers.cloudflare.com/durable-objects/">Durable Objects</a> are stateful and long-lived, commonly used to coordinate and persist real-time state in chat, multiplayer games, or collaborative apps. And unlike Workers, duration-based pricing fits Durable Objects well. As long as one or more clients are connected to a Durable Object, it keeps state available in memory. <a href="https://developers.cloudflare.com/durable-objects/platform/pricing/">Durable Objects pricing</a> will remain duration-based, and is not changing as part of this announcement.</p><p>What about when a client is connected to a Durable Object, but no work has happened for a long time? Consider a collaborative whiteboard app built using Durable Objects. A user of the app opens the app in a browser tab, but then forgets about it, and leaves it running for days, with an open WebSocket connection. Just like with Workers, we don’t think you should have to pay for this idle time. But until recently, there hasn’t been an API to signal to us that a Durable Object can be safely “hibernated”.</p><p>The recently introduced <a href="https://developers.cloudflare.com/durable-objects/api/hibernatable-websockets-api/">Hibernation API</a>, currently in beta, allows you to set an automatic response to be used while hibernated and serialize state such that it survives hibernation. This gives Cloudflare the inputs we need in order to maintain open WebSocket connections from clients, while “hibernating” the Durable Object such that it is not actively running, and you are not billed for idle time. The result is that your state is always available in-memory when actually need it, but isn’t unnecessarily kept around when it’s not. As long as your Durable Object is hibernating, even if there are active clients still connected over a WebSocket, you won’t be billed for duration.</p>
    <div>
      <h3>Snippets make Cloudflare’s CDN programmable — for free</h3>
      <a href="#snippets-make-cloudflares-cdn-programmable-for-free">
        
      </a>
    </div>
    <p>What if you just want to <a href="https://developers.cloudflare.com/workers/examples/alter-headers/">modify a header</a>, do a <a href="https://developers.cloudflare.com/workers/examples/country-code-redirect/">country code redirect</a>, or cache a custom query? Developers have relied on Workers to program Cloudflare’s CDN like this for many years. With the announcement of <a href="/snippets-announcement/">Cloudflare Snippets</a> last year, <a href="/cloudflare-snippets-alpha/">now in alpha</a>, we’re making it free.</p><p>If you use Workers today for these smaller use cases, to customize any of Cloudflare’s <a href="https://www.cloudflare.com/application-services/">application services</a>, Snippets will be the optimal, zero cost option.</p>
    <div>
      <h3>A serverless platform without limits</h3>
      <a href="#a-serverless-platform-without-limits">
        
      </a>
    </div>
    <p>Developers are building ever larger and more complex full-stack applications on Workers each month. Our promise to you is to help you scale in any direction, without worrying about paying for idle time or having to manage and provision compute resources across regions.</p><p>This also means not having to worry about limits. Workers already serves many millions of requests per second, and scales and performs so well that we are <a href="/building-cloudflare-on-cloudflare/">rebuilding our own CDN on top of Workers</a>. Individual Workers can now be <a href="https://developers.cloudflare.com/workers/platform/limits/#worker-size">up to 10MB</a>, with a max startup time of 400ms, and can be easily composed together using <a href="https://developers.cloudflare.com/workers/configuration/bindings/about-service-bindings/">Service Bindings</a>. Entire platforms are built on top of Workers, with a growing number of companies allowing their own customers to write and deploy custom code and applications via <a href="https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/">Workers for Platforms</a>. Some of the biggest platforms in the world rely on Cloudflare and the Workers platform <a href="https://www.cloudflare.com/case-studies/shopify/">during the most critical moments</a>.</p><p>New pricing removes limits on the types of applications that could be built cost effectively with duration-based pricing. It removes the ceiling on CPU time from our original request-based pricing. We’re excited to see what you build, and are committed to being the development platform where you’re not constrained by limits on scale, regions, instances, concurrency or whatever else you need to handle to grow and operate globally.</p>
    <div>
      <h3>When will new pricing be available?</h3>
      <a href="#when-will-new-pricing-be-available">
        
      </a>
    </div>
    <p>Starting October 31, 2023, you will have the option to opt in individual <a href="https://developers.cloudflare.com/workers/">Workers</a> and <a href="https://developers.cloudflare.com/pages/platform/functions/">Pages Functions</a> projects on your account to new pricing, and newly created projects will default to new pricing. You will have until March 1, 2024, or the end of your Enterprise contract, whichever comes later, to switch to new pricing on your own, after which all of your projects will be automatically migrated to new pricing. You’ll receive plenty of advance notice via email and dashboard notifications before any changes go into effect.</p><p>Between now and then, we want to hear from you. We’ve based new pricing off feedback we’ve heard from developers building serverless applications, and companies estimating and projecting their costs. Tell us what you think of new pricing by <a href="https://forms.gle/STBQRy39CX98p9n18">sharing your feedback in this survey</a>. We read every response.</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[Connectivity Cloud]]></category>
            <guid isPermaLink="false">2qLGARvMRZ2T9X8ccT4fPl</guid>
            <dc:creator>Rita Kozlov</dc:creator>
            <dc:creator>Brendan Irvine-Broque</dc:creator>
        </item>
        <item>
            <title><![CDATA[Announcing connect() — a new API for creating TCP sockets from Cloudflare Workers]]></title>
            <link>https://blog.cloudflare.com/workers-tcp-socket-api-connect-databases/</link>
            <pubDate>Tue, 16 May 2023 13:00:13 GMT</pubDate>
            <description><![CDATA[ Today, we are excited to announce a new API in Cloudflare Workers for creating outbound TCP sockets, making it possible to connect directly to databases and any TCP-based service from Workers ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1CjlPkdLJUXlfgIKgq2Jvy/d2e17e3027c02f82e191007561640f79/image2-12.png" />
            
            </figure><p>Today, we are excited to announce a new API in Cloudflare Workers for creating outbound TCP sockets, making it possible to connect directly to any TCP-based service from Workers.</p><p>Standard protocols including <a href="https://www.cloudflare.com/learning/access-management/what-is-ssh/">SSH</a>, MQTT, SMTP, FTP, and IRC are all built on top of TCP. Most importantly, nearly all applications need to connect to databases, and most databases speak TCP. And while <a href="https://developers.cloudflare.com/d1/">Cloudflare D1</a> works seamlessly on Workers, and some <a href="https://developers.cloudflare.com/workers/learning/integrations/databases/">hosted database providers</a> allow connections over HTTP or WebSockets, the vast majority of databases, both relational (SQL) and document-oriented (NoSQL), require clients to connect by opening a direct TCP “socket”, an ongoing two-way connection that is used to send queries and receive data. Now, Workers provides an API for this, the first of many steps to come in allowing you to use any database or infrastructure you choose when building full-stack applications on Workers.</p><p>Database drivers, the client code used to connect to databases and execute queries, are already using this new API. <a href="https://github.com/brianc/node-postgres">pg</a>, the most widely used JavaScript database driver for PostgreSQL, works on Cloudflare Workers today, with more database drivers to come.</p><p>The TCP Socket API is available today to everyone. Get started by reading the <a href="https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets">TCP Socket API docs</a>, or connect directly to any PostgreSQL database from your Worker by following <a href="https://developers.cloudflare.com/workers/databases/connect-to-postgres/">this guide</a>.</p>
    <div>
      <h2>First — what is a TCP Socket?</h2>
      <a href="#first-what-is-a-tcp-socket">
        
      </a>
    </div>
    <p><a href="https://www.cloudflare.com/learning/ddos/glossary/tcp-ip/">TCP (Transmission Control Protocol)</a> is a foundational networking protocol of the Internet. It is the underlying protocol that is used to make HTTP requests (prior to <a href="https://www.cloudflare.com/learning/performance/what-is-http3/">HTTP/3</a>, which uses <a href="https://cloudflare-quic.com/">QUIC</a>), to send email over <a href="https://www.cloudflare.com/learning/email-security/what-is-smtp/">SMTP</a>, to query databases using database–specific protocols like MySQL, and many other application-layer protocols.</p><p>A TCP socket is a programming interface that represents a two-way communication connection between two applications that have both agreed to “speak” over TCP. One application (ex: a Cloudflare Worker) initiates an outbound TCP connection to another (ex: a database server) that is listening for inbound TCP connections. Connections are established by negotiating a three-way handshake, and after the handshake is complete, data can be sent bi-directionally.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6xxArl43DbexJUoRmw8JrG/0ad545bb25f002a4598d387aca491997/image1-30.png" />
            
            </figure><p>A socket is the programming interface for a single TCP connection — it has both a readable and writable “stream” of data, allowing applications to read and write data on an ongoing basis, as long as the connection remains open.</p>
    <div>
      <h2>connect() — A simpler socket API</h2>
      <a href="#connect-a-simpler-socket-api">
        
      </a>
    </div>
    <p>With Workers, we aim to support standard APIs that are supported across browsers and non-browser environments wherever possible, so that as many NPM packages as possible work on Workers without changes, and package authors don’t have to write runtime-specific code. But for TCP sockets, we faced a challenge — there was no clear shared standard across runtimes. Node.js provides the <a href="https://nodejs.org/api/net.html">net</a> and <a href="https://nodejs.org/api/tls.html">tls</a> APIs, but Deno implements a different API — <a href="https://deno.land/api@v1.33.1?s=Deno.connect">Deno.connect</a>. And web browsers do not provide a raw TCP socket API, though a <a href="https://github.com/WICG/direct-sockets/blob/main/docs/explainer.md">WICG proposal</a> does exist, and it is different from both Node.js and Deno.</p><p>We also considered how a TCP socket API could be designed to maximize performance and ergonomics in a serverless environment. Most networking APIs were designed well before serverless emerged, with the assumption that the developer’s application is also the server, responsible for directly handling configuring TLS options and credentials.</p><p>With this backdrop, we reached out to the community, with a focus on maintainers of database drivers, ORMs and other libraries that create outbound TCP connections. Using this feedback, we’ve tried to incorporate the best elements of existing APIs and proposals, and intend to contribute back to future standards, as part of the <a href="/introducing-the-wintercg/">Web-interoperable Runtimes Community Group (WinterCG)</a>.</p><p>The API we landed on is a simple function, connect(), imported from the new cloudflare:sockets module, that returns an instance of a Socket. Here’s a simple example showing it used to connect to a <a href="https://www.w3.org/People/Bos/PROSA/rep-protocols.html#gopher">Gopher</a> server. Gopher was one of the Internet’s early protocols that relied on TCP/IP, and still works today:</p>
            <pre><code>import { connect } from 'cloudflare:sockets';

export default {
  async fetch(req: Request) {
    const gopherAddr = "gopher.floodgap.com:70";
    const url = new URL(req.url);

    try {
      const socket = connect(gopherAddr);

      const writer = socket.writable.getWriter()
      const encoder = new TextEncoder();
      const encoded = encoder.encode(url.pathname + "\r\n");
      await writer.write(encoded);

      return new Response(socket.readable, { headers: { "Content-Type": "text/plain" } });
    } catch (error) {
      return new Response("Socket connection failed: " + error, { status: 500 });
    }
  }
};</code></pre>
            <p>We think this API design has many benefits that can be realized not just on Cloudflare, but in any serverless environment that adopts this design:</p>
            <pre><code>connect(address: SocketAddress | string, options?: SocketOptions): Socket

declare interface Socket {
  get readable(): ReadableStream;
  get writable(): WritableStream;
  get closed(): Promise&lt;void&gt;;
  close(): Promise&lt;void&gt;;
  startTls(): Socket;
}

declare interface SocketOptions {
  secureTransport?: string;
  allowHalfOpen: boolean;
}

declare interface SocketAddress {
  hostname: string;
  port: number;
}</code></pre>
            
    <div>
      <h3>Opportunistic TLS (StartTLS), without separate APIs</h3>
      <a href="#opportunistic-tls-starttls-without-separate-apis">
        
      </a>
    </div>
    <p>Opportunistic TLS, a pattern of creating an initial insecure connection, and then upgrading it to a secure one that uses TLS, remains common, particularly with database drivers. In Node.js, you must use the <a href="https://nodejs.org/api/net.html#class-netsocket">net</a> API to create the initial connection, and then use the <a href="https://nodejs.org/api/tls.html">tls</a> API to create a new, upgraded connection. In Deno, you pass the original socket to <a href="https://deno.land/api@v1.33.1?s=Deno.startTls">Deno.startTls()</a>, which creates a new, upgraded connection.</p><p>Drawing on a <a href="https://www.w3.org/TR/tcp-udp-sockets/#idl-def-TCPOptions">previous W3C proposal</a> for a TCP Socket API, we’ve simplified this by providing one API, that allows TLS to be enabled, allowed, or used when creating a socket, and exposes a simple method, startTls(), for upgrading a socket to use TLS.</p>
            <pre><code>// Create a new socket without TLS. secureTransport defaults to "off" if not specified.
const socket = connect("address:port", { secureTransport: "off" })

// Create a new socket, then upgrade it to use TLS.
// Once startTls() is called, only the newly created socket can be used.
const socket = connect("address:port", { secureTransport: "starttls" })
const secureSocket = socket.startTls();

// Create a new socket with TLS
const socket = connect("address:port", { secureTransport: "use" })</code></pre>
            
    <div>
      <h3>TLS configuration — a concern of host infrastructure, not application code</h3>
      <a href="#tls-configuration-a-concern-of-host-infrastructure-not-application-code">
        
      </a>
    </div>
    <p>Existing APIs for creating TCP sockets treat TLS as a library that you interact with in your application code. The <a href="https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions">tls.createSecureContext()</a> API from Node.js has a plethora of advanced configuration options that are mostly environment specific. If you use custom certificates when connecting to a particular service, you likely use a different set of credentials and options in production, staging and development. Managing direct file paths to credentials across environments and swapping out .env files in production build steps are common pain points.</p><p>Host infrastructure is best positioned to manage this on your behalf, and similar to Workers support for <a href="/mtls-workers/">making subrequests using mTLS</a>, TLS configuration and credentials for the socket API will be managed via Wrangler, and a connect() function provided via a <a href="https://developers.cloudflare.com/workers/platform/bindings/">capability binding</a>. Currently, custom TLS credentials and configuration are not supported, but are coming soon.</p>
    <div>
      <h3>Start writing data immediately, before the TLS handshake finishes</h3>
      <a href="#start-writing-data-immediately-before-the-tls-handshake-finishes">
        
      </a>
    </div>
    <p>Because the connect() API synchronously returns a new socket, one can start writing to the socket immediately, without waiting for the TCP handshake to first complete. This means that once the handshake completes, data is already available to send immediately, and host platforms can make use of pipelining to optimize performance.</p>
    <div>
      <h2>connect() API + DB drivers = Connect directly to databases</h2>
      <a href="#connect-api-db-drivers-connect-directly-to-databases">
        
      </a>
    </div>
    <p>Many <a href="https://www.cloudflare.com/developer-platform/products/d1/">serverless databases</a> already work on Workers, allowing clients to connect over HTTP or over <a href="/neon-postgres-database-from-workers/">WebSockets</a>. But most databases don’t “speak” HTTP, including databases hosted on most cloud providers.</p><p>Databases each have their own “wire protocol”, and open-source database “drivers” that speak this protocol, sending and receiving data over a TCP socket. Developers rely on these drivers in their own code, as do database ORMs. Our goal is to make sure that you can use the same drivers and ORMs you might use in other runtimes and on other platforms on Workers.</p>
    <div>
      <h2>Try it now — connect to PostgreSQL from Workers</h2>
      <a href="#try-it-now-connect-to-postgresql-from-workers">
        
      </a>
    </div>
    <p>We’ve worked with the maintainers of <a href="https://www.npmjs.com/package/pg">pg</a>, one of the most popular database drivers in the JavaScript ecosystem, used by ORMs including <a href="https://sequelize.org/docs/v6/getting-started/">Sequelize</a> and <a href="https://knexjs.org/">knex.js</a>, to add support for connect().</p><p>You can try this right now. First, create a new Worker and install pg:</p>
            <pre><code>wrangler init
npm install --save pg</code></pre>
            <p>As of this writing, you’ll need to <a href="https://developers.cloudflare.com/workers/wrangler/configuration/#add-polyfills-using-wrangler">enable the node_compat</a> option in wrangler.toml:</p><p><b>wrangler.toml</b></p>
            <pre><code>name = "my-worker"
main = "src/index.ts"
compatibility_date = "2023-05-15"
node_compat = true</code></pre>
            <p>In just 20 lines of TypeScript, you can create a connection to a Postgres database, execute a query, return results in the response, and close the connection:</p><p><b>index.ts</b></p>
            <pre><code>import { Client } from "pg";

export interface Env {
  DB: string;
}

export default {
  async fetch(
    request: Request,
    env: Env,
    ctx: ExecutionContext
  ): Promise&lt;Response&gt; {
    const client = new Client(env.DB);
    await client.connect();
    const result = await client.query({
      text: "SELECT * from customers",
    });
    console.log(JSON.stringify(result.rows));
    const resp = Response.json(result.rows);
    // Close the database connection, but don't block returning the response
    ctx.waitUntil(client.end());
    return resp;
  },
};</code></pre>
            <p>To test this in local development, use the <code>--experimental-local</code> flag (instead of <code>–local</code>), which <a href="/miniflare-and-workerd/">uses the open-source Workers runtime</a>, ensuring that what you see locally mirrors behavior in production:</p>
            <pre><code>wrangler dev --experimental-local</code></pre>
            
    <div>
      <h2>What’s next for connecting to databases from Workers?</h2>
      <a href="#whats-next-for-connecting-to-databases-from-workers">
        
      </a>
    </div>
    <p>This is only the beginning. We’re aiming for the two popular MySQL drivers, <a href="https://github.com/mysqljs/mysql">mysql</a> and <a href="https://github.com/sidorares/node-mysql2">mysql2</a>, to work on Workers soon, with more to follow. If you work on a database driver or ORM, we’d love to help make your library work on Workers.</p><p>If you’ve worked more closely with database scaling and performance, you might have noticed that in the example above, a new connection is created for every request. This is one of the biggest current challenges of connecting to databases from serverless functions, across all platforms. With typical client connection pooling, you maintain a local pool of database connections that remain open. This approach of storing a reference to a connection or connection pool in global scope will not work, and is a poor fit for serverless. Managing individual pools of client connections on a per-isolate basis creates other headaches — when and how should connections be terminated? How can you limit the total number of concurrent connections across many isolates and locations?</p><p>Instead, we’re already working on simpler approaches to connection pooling for the most popular databases. We see a path to a future where you don’t have to think about or manage client connection pooling on your own. We’re also working on a brand new approach to making your database reads lightning fast.</p>
    <div>
      <h2>What’s next for sockets on Workers?</h2>
      <a href="#whats-next-for-sockets-on-workers">
        
      </a>
    </div>
    <p>Supporting outbound TCP connections is only one half of the story — we plan to support inbound TCP and UDP connections, as well as new emerging application protocols based on QUIC, so that you can build applications beyond HTTP with <a href="/introducing-socket-workers/">Socket Workers</a>.</p><p>Earlier today we also announced <a href="/announcing-workers-smart-placement">Smart Placement</a>, which improves performance by placing any Worker that makes multiple HTTP requests to an origin run as close as possible to reduce round-trip time. We’re working on making this work with Workers that open TCP connections, so that if your Worker connects to a database in Virginia and makes many queries over a TCP connection, each query is lightning fast and comes from the nearest location on <a href="https://www.cloudflare.com/network/">Cloudflare’s global network</a>.</p><p>We also plan to support custom certificates and other TLS configuration options in the coming months — tell us what is a must-have in order to connect to the services you need to connect to from Workers.</p>
    <div>
      <h2>Get started, and share your feedback</h2>
      <a href="#get-started-and-share-your-feedback">
        
      </a>
    </div>
    <p>The TCP Socket API is available today to everyone. Get started by reading the <a href="https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets">TCP Socket API docs</a>, or connect directly to any PostgreSQL database from your Worker by following <a href="https://developers.cloudflare.com/workers/databases/connect-to-postgres/">this guide</a>.</p><p>We want to hear your feedback, what you’d like to see next, and more about what you’re building. Join the <a href="https://discord.cloudflare.com/">Cloudflare Developers Discord</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[Developer Week]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[TCP]]></category>
            <category><![CDATA[Database]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">14RexUSLCzOVnpWl5DkGIq</guid>
            <dc:creator>Brendan Irvine-Broque</dc:creator>
            <dc:creator>Matt Silverlock</dc:creator>
        </item>
        <item>
            <title><![CDATA[Bringing the best live video experience to Cloudflare Stream with AV1]]></title>
            <link>https://blog.cloudflare.com/av1-cloudflare-stream-beta/</link>
            <pubDate>Wed, 05 Oct 2022 17:08:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare Stream now supports the AV1 codec for live video in open beta, unlocking live-streaming at higher resolution, with lower bandwidth ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Consumer hardware is pushing the limits of consumers’ bandwidth.</p><p>VR headsets support 5760 x 3840 resolution — 22.1 million pixels <i>per frame</i> of video. Nearly all new TVs and smartphones sold today now support 4K — 8.8 million pixels per frame. It’s now normal for most people on a subway to be casually streaming video on their phone, even as they pass through a tunnel. People expect all of this to just work, and get frustrated when it doesn’t.</p><p>Consumer Internet bandwidth hasn’t kept up. Even advanced mobile carriers still limit streaming video resolution to prevent network congestion. Many mobile users still have to monitor and limit their mobile data usage. Higher Internet speeds require expensive infrastructure upgrades, and 30% of Americans still say they often have problems <a href="https://www.pewresearch.org/internet/2021/06/03/mobile-technology-and-home-broadband-2021/">simply connecting to the Internet at home</a>.</p><p>We talk to developers every day who are pushing up against these limits, trying to deliver the highest quality streaming video without buffering or jitter, challenged by viewers’ expectations and bandwidth. Developers building live video experiences hit these limits the hardest — buffering doesn’t just delay video playback, it can cause the viewer to get out of sync with the live event. Buffering can cause a sports fan to miss a key moment as playback suddenly skips ahead, or find out in a text message about the outcome of the final play, before they’ve had a chance to watch.</p><p>Today we’re announcing a big step towards breaking the ceiling of these limits — support in <a href="https://www.cloudflare.com/products/cloudflare-stream/">Cloudflare Stream</a> for the <a href="https://aomedia.org/av1-features/">AV1</a> codec for live videos and their recordings, available today to all Cloudflare Stream customers in open beta. Read <a href="https://developers.cloudflare.com/stream/viewing-videos/av1-playback/">the docs</a> to get started, or <a href="https://cool-sf-videos.pages.dev/">watch an AV1 video</a> from Cloudflare Stream in your web browser. AV1 is an open and royalty-free video codec that uses <a href="https://engineering.fb.com/2018/04/10/video-engineering/av1-beats-x264-and-libvpx-vp9-in-practical-use-case/">46% less bandwidth than H.264</a>, the most commonly used video codec on the web today.</p>
    <div>
      <h3>What is AV1, and how does it improve live video streaming?</h3>
      <a href="#what-is-av1-and-how-does-it-improve-live-video-streaming">
        
      </a>
    </div>
    <p>Every piece of information that travels across the Internet, from web pages to photos, requires data to be transmitted between two computers. A single character usually takes one byte, so a two-page letter would be 3600 bytes or 3.6 kilobytes of data transferred.</p><p>One pixel in a photo takes 3 bytes, one each for red, green and blue in the pixel. A 4K photo would take 8,294,400 bytes, or 8.2 Megabytes. A video is like a photo that changes 30 times a second, which would make almost 15 Gigabytes per minute. That’s a lot!</p><p>To reduce the amount of bandwidth needed to stream video, before video is sent to your device, it is compressed using a codec. When your device receives video, it decodes this into the pixels displayed on your screen. These codecs are essential to both streaming and storing video.</p><p>Video compression codecs combine multiple advanced techniques, and are able to compress video to one percent of the original size, with your eyes barely noticing a difference. This also makes video codecs computationally intensive and hard to run. Smartphones, laptops and TVs have specific media decoding hardware, separate from the main CPU, optimized to decode specific protocols quickly, using the minimum amount of battery life and power.</p><p>Every few years, as researchers invent more efficient compression techniques, standards bodies release new codecs that take advantage of these improvements. Each generation of improvements in compression technology increases the requirements for computers that run them. With higher requirements, new chips are made available with increased compute capacity. These new chips allow your device to display higher quality video while using less bandwidth.</p><p>AV1 takes advantage of recent advances in compute to deliver video with dramatically fewer bytes, even compared to other relatively recent video protocols like VP9 and HEVC.</p>
    <div>
      <h3>AV1 leverages the power of new smartphone chips</h3>
      <a href="#av1-leverages-the-power-of-new-smartphone-chips">
        
      </a>
    </div>
    <p>One of the biggest developments of the past few years has been the rise of custom chip designs for smartphones. Much of what’s driven the development of these chips is the need for advanced on-device image and video processing, as companies compete on the basis of which smartphone has the best camera.</p><p>This means the phones we carry around have an incredible amount of compute power. One way to think about AV1 is that it shifts work from the network to the viewer’s device. AV1 is fewer bytes over the wire, but computationally harder to decode than prior formats. When AV1 was first announced in 2018, it was dismissed by some as too slow to encode and decode, but smartphone chips have become radically faster in the past four years, more quickly than many saw coming.</p><p>AV1 hardware decoding is already built into the latest Google Pixel smartphones as part of the Tensor chip design. The <a href="https://semiconductor.samsung.com/processor/mobile-processor/exynos-2200/">Samsung Exynos 2200</a> and <a href="https://www.mediatek.com/products/smartphones-2/dimensity-1000-series">MediaTek Dimensity 1000 SoC</a> mobile chipsets both support hardware accelerated AV1 decoding. It appears that Google will <a href="https://android.googlesource.com/platform/cts/+/9203e0379bbb8991cdfee39e2a894d236bfaca8e?cf_target_id=EB3A10F16F1C7B0D8AE3D87D702DDC4A">require</a> that all devices that support Android 14 support decoding AV1. And AVPlayer, the media playback API built into iOS and tvOS, now <a href="https://developer.apple.com/documentation/coremedia/1564239-video_codec_constants/kcmvideocodectype_av1">includes an option for AV1</a>, which hints at future support. It’s clear that the industry is heading towards hardware-accelerated AV1 decoding in the most popular consumer devices.</p><p>With hardware decoding comes battery life savings — essential for both today’s smartphones and tomorrow’s VR headsets. For example, a Google Pixel 6 with AV1 hardware decoding uses only minimal battery and CPU to decode and play our <a href="https://cool-sf-videos.pages.dev/">test video</a>:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1vbKm1xvDV6JE2Z9Jkn0rO/b0809152c1eb4f589c098530f254f223/image1-5.png" />
            
            </figure>
    <div>
      <h3>AV1 encoding requires even more compute power</h3>
      <a href="#av1-encoding-requires-even-more-compute-power">
        
      </a>
    </div>
    <p>Just as decoding is significantly harder for end-user devices, it is also significantly harder to encode video using AV1. When AV1 was announced in 2018, many doubted whether hardware would be able to encode it efficiently enough for the protocol to be adopted quickly enough.</p><p>To demonstrate this, we encoded the 4K rendering of <a href="https://peach.blender.org/">Big Buck Bunny</a> (a classic among video engineers!) into AV1, using an AMD EPYC 7642 48-Core Processor with 256 GB RAM. This CPU continues to be a workhorse of our compute fleet, as we have <a href="/an-epyc-trip-to-rome-amd-is-cloudflares-10th-generation-edge-server-cpu/">written about previously</a>. We used the following command to re-encode the video, <a href="https://trac.ffmpeg.org/wiki/Encode/AV1">based on the example in the ffmpeg AV1 documentation:</a></p><p><code>ffmpeg -i bbb_sunflower_2160p_30fps_normal.mp4 -c:v libaom-av1 -crf 30 -b:v 0 -strict -2 av1_test.mkv</code></p><p>Using a single core, encoding just two seconds of video at 30fps took over 30 minutes. Even if all 48 cores were used to encode, it would take at minimum over 43 seconds to encode just two seconds of video. Live encoding using only CPUs would require over 20 servers running at full capacity.</p><p>Special-purpose AV1 software encoders like <a href="https://github.com/xiph/rav1e">rav1e</a> and <a href="https://gitlab.com/AOMediaCodec/SVT-AV1">SVT-AV1</a> that run on general purpose CPUs can encode somewhat faster than <a href="https://trac.ffmpeg.org/wiki/Encode/AV1">libaom-av1</a> with ffmpeg, but still consume a huge amount of compute power to encode AV1 in real-time, requiring multiple servers running at full capacity in many scenarios.</p>
    <div>
      <h3>Cloudflare Stream encodes your video to AV1 in real-time</h3>
      <a href="#cloudflare-stream-encodes-your-video-to-av1-in-real-time">
        
      </a>
    </div>
    <p>At Cloudflare, we control both the hardware and software on our network. So to solve the CPU constraint, we’ve installed dedicated AV1 hardware encoders, designed specifically to encode AV1 at blazing fast speeds. This end to end control is what lets us encode your video to AV1 in real-time. This is entirely out of reach to most public cloud customers, including the video infrastructure providers who depend on them for compute power.</p><p>Encoding in real-time means you can use AV1 for live video streaming, where saving bandwidth matters most. With a pre-recorded video, the client video player can fetch future segments of video well in advance, relying on a buffer that can be many tens of seconds long. With live video, buffering is constrained by latency — it’s not possible to build up a large buffer when viewing a live stream. There is less margin for error with live streaming, and every byte saved means that if a viewer’s connection is interrupted, it takes less time to recover before the buffer is empty.</p>
    <div>
      <h3>Stream lets you support AV1 with no additional work</h3>
      <a href="#stream-lets-you-support-av1-with-no-additional-work">
        
      </a>
    </div>
    <p>AV1 has a chicken or the egg dilemma. And we’re helping solve it.</p><p>Companies with large video libraries often re-encode their entire content library to a new codec before using it. But AV1 is so computationally intensive that re-encoding whole libraries has been cost prohibitive. Companies have to choose specific videos to re-encode, and guess which content will be most viewed ahead of time. This is particularly challenging for apps with user generated content, where content can suddenly go viral, and viewer patterns are hard to anticipate.</p><p>This has slowed down the adoption of AV1 — content providers wait for more devices to support AV1, and device manufacturers wait for more content to use AV1. Which will come first?</p><p>With Cloudflare Stream there is no need to manually trigger re-encoding, re-upload video, or manage the bulk encoding of a large video library. This is a unique approach that is made possible by integrating encoding and delivery into a single product — it is not possible to encode on-demand using the old way of encoding first, and then pointing a CDN at a bucket of pre-encoded files.</p><p>We think this approach can accelerate the adoption of AV1. Consider a video app with millions of minutes of user-generated video. Most videos will never be watched again. In the old model, developers would have to spend huge sums of money to encode upfront, or pick and choose which videos to re-encode. With Stream, we can help anyone incrementally adopt AV1, without re-encoding upfront. As we work towards making AV1 Generally Available, we’ll be working to make supporting AV1 simple and painless, even for videos already uploaded to Stream, with no special configuration necessary.</p>
    <div>
      <h3>Open, royalty-free, and widely supported</h3>
      <a href="#open-royalty-free-and-widely-supported">
        
      </a>
    </div>
    <p>At Cloudflare, we are committed to open standards and <a href="/tag/patent-troll/">fighting patent trolls</a>. While there are multiple competing options for new video codecs, we chose to support AV1 first in part because it is open source and has royalty-free licensing.</p><p>Other encoding codecs force device manufacturers to pay royalty fees in order to adopt their standard in consumer hardware, and have been quick to file lawsuits against competing video codecs. The group behind the open and royalty-free VP8 and VP9 codecs have been pushing back against this model for more than a decade, and AV1 is the successor to these codecs, with support from all the <a href="https://aomedia.org/membership/members/">biggest technology companies</a>, both software and hardware. Beyond its technical accomplishments, AV1 is a clear message from the industry that the future of video encoding should be open, royalty-free, and free from patent litigation.</p>
    <div>
      <h3>Try AV1 right now with <b><i>your</i></b> live stream or live recording</h3>
      <a href="#try-av1-right-now-with-your-live-stream-or-live-recording">
        
      </a>
    </div>
    <p>Support for AV1 is currently in open beta. You can try using AV1 on your own live video with Cloudflare Stream right now — just add the <code>?betaCodecSuggestion=av1</code> query parameter to the HLS or DASH manifest URL for any live stream or live recording created after October 1st in Cloudflare Stream. <a href="https://developers.cloudflare.com/stream/viewing-videos/av1-playback/">Read the docs</a> to get started. If you don’t yet have a Cloudflare account, you can sign up <a href="https://dash.cloudflare.com/sign-up/stream">here</a> and start using Cloudflare Stream in just a few minutes.</p><p>We also have a recording of a live video, encoded using AV1, that you can watch <a href="https://cool-sf-videos.pages.dev/">here</a>. Note that Safari does not yet support AV1.</p><p>We encourage you to try AV1 with your test streams, and we’d love your feedback. Join our <a href="https://discord.com/invite/cloudflaredev/">Discord channel</a> and tell us what you’re building, and what kinds of video you’re interested in using AV1 with. We’d love to hear from you!</p> ]]></content:encoded>
            <category><![CDATA[Cloudflare Stream]]></category>
            <category><![CDATA[Video]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">1VBAndDQEb6dfu5nhqoTvb</guid>
            <dc:creator>Renan Dincer</dc:creator>
            <dc:creator>Brendan Irvine-Broque</dc:creator>
            <dc:creator>Chris Howells</dc:creator>
            <dc:creator>Ryan Schachte</dc:creator>
        </item>
        <item>
            <title><![CDATA[WebRTC live streaming to unlimited viewers, with sub-second latency]]></title>
            <link>https://blog.cloudflare.com/webrtc-whip-whep-cloudflare-stream/</link>
            <pubDate>Tue, 27 Sep 2022 13:00:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare Stream now supports live streaming over WebRTC to unlimited concurrent viewers, using open standards WHIP and WHEP, with zero dependencies or client SDKs necessary. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Creators and broadcasters expect to be able to go live from anywhere, on any device. Viewers expect “live” to mean “real-time”. The protocols that power most live streams are unable to meet these growing expectations.</p><p>In talking to developers building live streaming into their apps and websites, we’ve heard near universal frustration with the limitations of existing live streaming technologies. Developers in 2022 rightly expect to be able to deliver low latency to viewers, broadcast reliably, and use web standards rather than old protocols that date back to the era of Flash.</p><p>Today, we’re excited to announce in open beta that Cloudflare Stream now supports live video streaming over WebRTC, with sub-second latency, to unlimited concurrent viewers. This is a new feature of Cloudflare Stream, and you can start using it right now in the Cloudflare Dashboard — read the <a href="https://developers.cloudflare.com/stream/webrtc-beta/">docs</a> to get started.</p><p>WebRTC with Cloudflare Stream leapfrogs existing tools and protocols, exclusively uses open standards with zero dependency on a specific SDK, and empowers any developer to build both low latency live streaming and playback into their website or app.</p>
    <div>
      <h3>The status quo of streaming live video is broken</h3>
      <a href="#the-status-quo-of-streaming-live-video-is-broken">
        
      </a>
    </div>
    <p>The status quo of streaming live video has high latency, depends on archaic protocols and is incompatible with the way developers build apps and websites. A reasonable person’s expectations of what the Internet should be able to deliver in 2022 are simply unmet by the dominant set of protocols carried over from past eras.</p><p><b>Viewers</b> increasingly expect “live” to mean “real-time”. People want to place bets on sports broadcasts in real-time, interact and ask questions to presenters in real-time, and never feel behind their friends at a live event.</p><p>In practice, the HLS and DASH standards used to deliver video have 10+ seconds of latency. LL-HLS and LL-DASH bring this down to closer to 5 seconds, but only as a hack on top of the existing protocol that delivers segments of video in individual HTTP requests. Sending mini video clips over TCP simply cannot deliver video in real-time. HLS and DASH are here to stay, but aren’t the future of real-time live video.</p><p><b>Creators and broadcasters</b> expect to be able to go live from anywhere, on any device.</p><p>In practice, people creating live content are stuck with a limited set of native apps, and can’t go live using RTMP from a web browser. Because it’s built on top of TCP, the RTMP broadcasting protocol struggles under even the slightest network disruption, making it a poor or often unworkable option when broadcasting from mobile networks. RTMP, originally built for use with Adobe Flash Player, was <a href="https://rtmp.veriskope.com/pdf/rtmp_specification_1.0.pdf">last updated in 2012</a>, and while Stream supports the <a href="/magic-hdmi-cable/">newer SRT protocol</a>, creators need an option that works natively on the web and can more easily be integrated in native apps.</p><p><b>Developers</b> expect to be able to build using standard APIs that are built into web browsers and native apps.</p><p>In practice, RTMP can’t be used from a web browser, and creating a native app that supports RTMP broadcasting typically requires diving into lower-level programming languages like C and Rust. Only those with expertise in both live video protocols and these languages have full access to the tools needed to create novel live streaming client applications.</p>
    <div>
      <h3>We’re solving this by using new open WebRTC standards: WHIP and WHEP</h3>
      <a href="#were-solving-this-by-using-new-open-webrtc-standards-whip-and-whep">
        
      </a>
    </div>
    <p>WebRTC is the real-time communications protocol, supported across all web browsers, that powers video calling services like Zoom and Google Meet. Since inception it’s been designed for real-time, ultra low-latency communications.</p><p>While WebRTC is well established, for most of its history it’s lacked standards for:</p><ul><li><p><b>Ingestion</b> — how broadcasters should <b><i>send</i></b> media content (akin to RTMP today)</p></li><li><p><b>Egress</b> — how viewers request and <b><i>receive</i></b> media content (akin to DASH or HLS today)</p></li></ul><p>As a result, developers have had to implement this on their own, and client applications on both sides are often tightly coupled to provider-specific implementations. Developers we talk to often express frustration, having sunk months of engineering work into building around a specific vendor’s SDK, unable to switch without a significant rewrite of their client apps.</p><p>At Cloudflare, our mission is broader — we’re helping to build a better Internet. Today we’re launching not just a new feature of Cloudflare Stream, but a vote of confidence in new WebRTC standards for both ingestion and egress. We think you should be able to start using Stream without feeling locked into an SDK or implementation specific to Cloudflare, and we’re committed to using open standards whenever possible.</p><p>For ingestion, <a href="https://www.ietf.org/archive/id/draft-ietf-wish-whip-03.html">WHIP</a> is an IETF draft on the Standards Track, with many applications already successfully using it in production. For delivery (egress), <a href="https://www.ietf.org/id/draft-murillo-whep-00.html">WHEP</a> is an IETF draft with broad agreement. Combined, they provide a standardized end-to-end way to broadcast one-to-many over WebRTC at scale.</p><p><b>Cloudflare Stream is the first cloud service to let you both broadcast using WHIP and playback using WHEP — no vendor-specific SDK needed.</b> Here’s how it works:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/19Hq5GYMLCWmxGoKQBiifO/0cd900cb0c07cfac25f14c2486a3cb77/image2-44.png" />
            
            </figure><p>Cloudflare Stream is already built on top of the Cloudflare developer platform, using Workers and Durable Objects running on Cloudflare’s global network, within 50ms of 95% of the world’s Internet-connected population.</p><p>Our WebRTC implementation extends this to relay WebRTC video through our network. Broadcasters stream video using WHIP to the point of presence closest to their location, which tells the Durable Object where the live stream can be found. Viewers request streaming video from the point of presence closest to them, which asks the Durable Object where to find the stream, and video is routed through Cloudflare’s network, all with sub-second latency.</p><p>Using Durable Objects, we achieve this with zero centralized state. And just like the rest of Cloudflare Stream, you never have to think about regions, both in terms of pricing and product development.</p><p>While existing ultra low-latency streaming providers charge significantly more to stream over WebRTC, because Stream runs on Cloudflare’s global network, we’re able to offer WebRTC streaming at the same price as delivering video over HLS or DASH. We don’t think you should be penalized with higher pricing when choosing which technology to rely on to stream live video. Once generally available, WebRTC streaming will cost $1 per 1000 minutes of video delivered, just like the rest of Stream.</p>
    <div>
      <h3>What does sub-second latency let you build?</h3>
      <a href="#what-does-sub-second-latency-let-you-build">
        
      </a>
    </div>
    <p>Ultra low latency unlocks interactivity within your website or app, removing the time delay between creators, in-person attendees, and those watching remotely.</p><p>Developers we talk to are building everything from live sports betting, to live auctions, to live viewer Q&amp;A and even real-time collaboration in video post-production. Even streams without in-app interactivity can benefit from real-time — no sports fan wants to get a text from their friend at the game that ruins the moment, before they’ve had a chance to watch the final play. Whether you’re bringing an existing app or have a new idea in mind, we’re excited to see what you build.</p>
    <div>
      <h3>If you can write JavaScript, you can let your users go live from their browser</h3>
      <a href="#if-you-can-write-javascript-you-can-let-your-users-go-live-from-their-browser">
        
      </a>
    </div>
    <p>While hobbyist and professional creators might take the time to download and learn how to use an application like <a href="https://obsproject.com/">OBS Studio</a>, most Internet users won’t get past this friction of new tools, and copying RTMP keys from one tool to another. To empower more people to go live, they need to be able to broadcast from within your website or app, just by enabling access to the camera and microphone.</p><p>Cloudflare Stream with WebRTC lets you build live streaming into your app as a front-end developer, without any special knowledge of video protocols. And our approach, using the WHIP and WHEP open standards, means you can do this with zero dependencies, with 100% your code that you control.</p>
    <div>
      <h3>Go live from a web browser with just a few lines of code</h3>
      <a href="#go-live-from-a-web-browser-with-just-a-few-lines-of-code">
        
      </a>
    </div>
    <p>You can go live right now, from your web browser, by creating a live input in the <a href="https://dash.cloudflare.com/?to=/:account/stream/inputs">Cloudflare Stream dashboard</a>, and pasting a URL into the example linked below.</p><p>Read the <a href="https://developers.cloudflare.com/stream/webrtc-beta/">docs</a> or <a href="https://workers.new/stream/webrtc">run the example code below in your browser using Stackblitz</a>.</p>
            <pre><code>&lt;video id="input-video" autoplay autoplay muted&gt;&lt;/video&gt;</code></pre>
            
            <pre><code>import WHIPClient from "./WHIPClient.js";

const url = "&lt;WEBRTC_URL_FROM_YOUR_LIVE_INPUT&gt;";
const videoElement = document.getElementById("input-video");
const client = new WHIPClient(url, videoElement);</code></pre>
            <p>This example uses an example WHIP client, written in just 100 lines of Javascript, using APIs that are native to web browsers, with zero dependencies. But because WHIP is an open standard, you can use any WHIP client you choose. Support for WHIP is growing across the video streaming industry — it has recently been added to <a href="https://gstreamer.freedesktop.org/">Gstreamer</a>, and one of the authors of the WHIP specification has written a <a href="https://github.com/medooze/whip-js">Javascript client implementation</a>. We intend to support the full <a href="https://www.ietf.org/archive/id/draft-ietf-wish-whip-03.html">WHIP specification</a>, including supporting <a href="https://www.rfc-editor.org/rfc/rfc8838">Trickle ICE</a> for fast NAT traversal.</p>
    <div>
      <h3>Play a live stream in a browser, with sub-second latency, no SDK required</h3>
      <a href="#play-a-live-stream-in-a-browser-with-sub-second-latency-no-sdk-required">
        
      </a>
    </div>
    <p>Once you’ve started streaming, copy the playback URL from the live input you just created, and paste it into the example linked below.</p><p>Read the <a href="https://developers.cloudflare.com/stream/webrtc-beta/">docs</a> or <a href="https://workers.new/stream/webrtc">run the example code below in your browser using Stackbltiz</a>.</p>
            <pre><code>&lt;video id="playback" controls autoplay muted&gt;&lt;/video&gt;</code></pre>
            
            <pre><code>import WHEPClient from './WHEPClient.js';
const url = "&lt;WEBRTC_PLAYBACK_URL_FROM_YOUR_LIVE_INPUT&gt;";
const videoElement = document.getElementById("playback");
const client = new WHEPClient(url, videoElement);</code></pre>
            <p>Just like the WHIP example before, this one uses an example WHEP client we’ve written that has zero dependencies. WHEP is an earlier IETF draft than WHIP, <a href="https://www.ietf.org/id/draft-murillo-whep-00.html">published in July of this year</a>, but adoption is moving quickly. People in the community have already written open-source client implementations in both <a href="https://github.com/medooze/whip-js/blob/main/whep.js">Javascript</a>, <a href="https://github.com/meetecho/simple-whep-client">C</a>, with more to come.</p>
    <div>
      <h3>Start experimenting with real-time live video, in open beta today</h3>
      <a href="#start-experimenting-with-real-time-live-video-in-open-beta-today">
        
      </a>
    </div>
    <p>WebRTC streaming is in open beta today, ready for you to use as an integrated feature of <a href="https://www.cloudflare.com/products/cloudflare-stream/">Cloudflare Stream</a>. Once Generally Available, WebRTC streaming will be priced like the rest of Cloudflare Stream, based on minutes of video delivered and minutes stored.</p><p><a href="https://developers.cloudflare.com/stream/webrtc-beta/">Read the docs</a> to get started.</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Cloudflare Stream]]></category>
            <category><![CDATA[Video]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Developers]]></category>
            <guid isPermaLink="false">5PQXX1PxT5vsDahi24H7Cn</guid>
            <dc:creator>Kyle Boutette</dc:creator>
            <dc:creator>Kenny Luong</dc:creator>
            <dc:creator>Brendan Irvine-Broque</dc:creator>
            <dc:creator>Jacob Curtis</dc:creator>
            <dc:creator>Rachel Chen</dc:creator>
            <dc:creator>Felipe Astroza Araya</dc:creator>
            <dc:creator>Renan Dincer</dc:creator>
        </item>
        <item>
            <title><![CDATA[Stream Live is now Generally Available]]></title>
            <link>https://blog.cloudflare.com/stream-live-ga/</link>
            <pubDate>Wed, 21 Sep 2022 13:15:00 GMT</pubDate>
            <description><![CDATA[ Stream Live is now out of beta, available to everyone, and ready for production traffic at scale ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Today, we’re excited to announce that Stream Live is out of beta, available to everyone, and ready for production traffic at scale. Stream Live is a feature of <a href="https://www.cloudflare.com/products/cloudflare-stream/">Cloudflare Stream</a> that allows developers to build live video features in websites and native apps.</p><p>Since its <a href="/stream-live/">beta launch</a>, developers have used Stream to broadcast live concerts from some of the world’s most popular artists directly to fans, build brand-new video creator platforms, operate a global 24/7 live OTT service, and more. While in beta, Stream has ingested millions of minutes of live video and delivered to viewers all over the world.</p><p><b>Bring your big live events, ambitious new video subscription service, or the next mobile video app with millions of users — we’re ready for it.</b></p>
    <div>
      <h2>Streaming live video at scale is hard</h2>
      <a href="#streaming-live-video-at-scale-is-hard">
        
      </a>
    </div>
    <p><b>Live video uses a massive amount of bandwidth.</b> For example, a one-hour live stream at 1080p at 8Mbps is 3.6GB. At <a href="/aws-egregious-egress/">typical cloud provider egress prices</a>, even a little egress can break the bank.</p><p><b>Live video must be encoded on-the-fly, in real-time.</b> People expect to be able to watch live video on their phone, while connected to mobile networks with less bandwidth, higher latency and frequently interrupted connections. To support this, live video must be re-encoded in real-time into multiple resolutions, allowing someone’s phone to drop to a lower resolution and continue playback. This can be complex (Which bitrates? Which codecs? How many?) and costly: running a fleet of virtual machines doesn’t come cheap.</p><p><b>Ingest location matters</b> — Live streaming protocols like RTMPS send video over TCP. If a single packet is dropped or lost, the entire connection is brought to a halt while the packet is found and re-transmitted. This is known as “head of line blocking”. The further away the broadcaster is from the ingest server, the more network hops, and the more likely packets will be dropped or lost, ultimately resulting in latency and buffering for viewers.</p><p><b>Delivery location matters</b> — Live video must be cached and served from points of presence as close to viewers as possible. The longer the network round trips, the more likely videos will buffer or drop to a lower quality.</p><p><b>Broadcasting protocols are in flux</b> — The most widely used protocol for streaming live video, RTMPS, has been abandoned since 2012, and dates back to the era of Flash video in the early 2000s. A new emerging standard, SRT, is not yet supported everywhere. And WebRTC has only recently evolved into an option for high definition one-to-many broadcasting at scale.</p><p>The old way to solve this has been to stitch together separate cloud services from different vendors. One vendor provides excellent content delivery, but no encoding. Another provides APIs or hardware to encode, but leaves you to fend for yourself and build your own storage layer. As a developer, you have to learn, manage and write a layer of glue code around the esoteric details of video streaming protocols, codecs, encoding settings and delivery pipelines.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7epyhfBFSlN7AMdqROyaNE/3a8b0ad09f7f60f6438ace8adf8d1141/image4-8.png" />
            
            </figure><p>We built Stream Live to make streaming live video easy, like adding an  tag to a website. Live video is now a fundamental building block of Internet content, and we think any developer should have the tools to add it to their website or native app.</p><p>With Stream, you or your users stream live video directly to Cloudflare, and Cloudflare delivers video directly to your viewers. You never have to manage internal encoding, storage, or delivery systems — it’s just live video in and live video out.</p>
    <div>
      <h2>Our network, our hardware = a solution only Cloudflare can provide</h2>
      <a href="#our-network-our-hardware-a-solution-only-cloudflare-can-provide">
        
      </a>
    </div>
    <p>We’re not the only ones building APIs for live video — but we are the only ones with our <b><i>own</i></b> global network and hardware that we control and optimize for video. That lets us do things that others can’t, like <a href="/magic-hdmi-cable/">sub-second glass-to-glass latency</a> using RTMPS and SRT playback at scale.</p><p>Newer video codecs require specialized hardware encoders, and while others are beholden to the hardware limitations of public cloud providers, we’re already hard at work installing the latest encoding hardware in our own racks, so that you can deliver high resolution video with even less bandwidth. Our goal is to make what is otherwise only available to video giants available directly to you — stay tuned for some exciting updates on this next week.</p><p>Most providers limit how many destinations you can restream or simulcast to. Because we operate our own network, we’ve never even worried about this, and let you <a href="https://developers.cloudflare.com/stream/stream-live/simulcasting/">restream to as many destinations as you need</a>.</p><p>Operating our own network lets us price Stream based on minutes of video delivered — unlike others, we don’t pay someone else for bandwidth and then pass along their costs to you at a markup. The status quo of charging for bandwidth or per-GB storage penalizes you for delivering or storing high resolution content. If you ask why a few times, most of the time you’ll discover that others are pushing their own cost structures on to you.</p><p>Encoding video is compute-intensive, delivering video is bandwidth intensive, and location matters when ingesting live video. When you use Stream, you don't need to worry about optimizing performance, finding a CDN, and/or tweaking configuration endlessly. Stream takes care of this for you.</p>
    <div>
      <h2>Free your live video from the business models of big platforms</h2>
      <a href="#free-your-live-video-from-the-business-models-of-big-platforms">
        
      </a>
    </div>
    <p>Nearly every business uses live video, whether to engage with customers, broadcast events or monetize live content. But few have the specialized engineering resources to deliver live video at scale on their own, and wire together multiple low level cloud services. To date, many of the largest content creators have been forced to depend on a shortlist of social media apps and streaming services to deliver live content at scale.</p><p>Unlike the status quo, who force you to put your live video in <i>their</i> apps and services and fit <i>their</i> business models, Stream gives you full control of your live video, on <i>your</i> website or app, on any device, at scale, without pushing your users to someone else’s service.</p>
    <div>
      <h2>Free encoding. Free ingestion. Free analytics. Simple per-minute pricing.</h2>
      <a href="#free-encoding-free-ingestion-free-analytics-simple-per-minute-pricing">
        
      </a>
    </div>
    
<table>
<thead>
  <tr>
    <th></th>
    <th><span>Others</span></th>
    <th><span>Stream</span></th>
  </tr>
</thead>
<tbody>
  <tr>
    <td><span>Encoding</span></td>
    <td><span>$ per minute</span></td>
    <td><span>Free</span></td>
  </tr>
  <tr>
    <td><span>Ingestion</span></td>
    <td><span>$ per GB</span></td>
    <td><span>Free</span></td>
  </tr>
  <tr>
    <td><span>Analytics</span></td>
    <td><span>Separate product</span></td>
    <td><span>Free</span></td>
  </tr>
  <tr>
    <td><span>Live recordings</span></td>
    <td><span>Minutes or hours later</span></td>
    <td><span>Instant</span></td>
  </tr>
  <tr>
    <td><span>Storage</span></td>
    <td><span>$ per GB </span></td>
    <td><span>per minute stored</span></td>
  </tr>
  <tr>
    <td><span>Delivery</span></td>
    <td><span>$ per GB</span></td>
    <td><span>per minute delivered</span></td>
  </tr>
</tbody>
</table><p>Other platforms charge for ingestion and encoding. Many even force you to consider where you’re streaming to and from, the bitrate and frames per second of your video, and even which of their datacenters you’re using.</p><p><b>With Stream, encoding and ingestion are free.</b> Other platforms charge for delivery based on bandwidth, penalizing you for delivering high quality video to your viewers. If you stream at a high resolution, you pay more.</p><p><b>With Stream, you don’t pay a penalty for delivering high resolution video.</b> Stream’s pricing is simple — minutes of video delivered and stored. Because you pay per minute, not per gigabyte, you can stream at the ideal resolution for your viewers without worrying about bandwidth costs.</p><p>Other platforms charge separately for analytics, requiring you to buy another product to get metrics about your live streams.</p><p><b>With Stream, analytics are free.</b> Stream provides an <a href="https://developers.cloudflare.com/stream/getting-analytics/fetching-bulk-analytics/">API</a> and <a href="https://dash.cloudflare.com/?to=/:account/stream/analytics">Dashboard</a> for both server-side and client-side analytics, that can be queried on a per-video, per-creator, per-country basis, and more. You can use analytics to identify which creators in your app have the most viewed live streams, inform how much to bill your customers for their own usage, identify where content is going viral, and more.</p><p>Other platforms tack on live recordings or DVR mode as a separate add-on feature, and recordings only become available minutes or even hours after a live stream ends.</p><p><b>With Stream, live recordings are a built-in feature, made available</b> <a href="https://developers.cloudflare.com/stream/stream-live/watch-live-stream/#replaying-recordings"><b>instantly after a live stream ends</b></a><b>.</b> Once a live stream is available, it works just like any other video uploaded to Stream, letting you seamlessly use the same APIs for managing both pre-recorded and live content.</p>
    <div>
      <h2>Build live video into your website or app in minutes</h2>
      <a href="#build-live-video-into-your-website-or-app-in-minutes">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/HKXLvVWCAI0VaDcIf4JN5/97f176769b109ffae59440f0f3073f8b/image1-26.png" />
            
            </figure><p>Cloudflare Stream enables you or your users to go live using the same protocols and tools that broadcasters big and small use to go live to YouTube or Twitch, but gives you full control over access and presentation of live streams.</p>
    <div>
      <h3>Step 1: Create a live input</h3>
      <a href="#step-1-create-a-live-input">
        
      </a>
    </div>
    <p><a href="https://dash.cloudflare.com/?to=/:account/stream/inputs/create">Create a new live input from the Stream Dashboard</a> or use use the Stream API:</p><p><b>Request</b></p>
            <pre><code>curl -X POST \
-H "Authorization: Bearer &lt;YOUR_API_TOKEN&gt;" \
-d "{"recording": { "mode": "automatic" } }" \
https://api.cloudflare.com/client/v4/accounts/&lt;YOUR_CLOUDFLARE_ACCOUNT_ID&gt;/stream/live_inputs</code></pre>
            <p><b>Response</b></p>
            <pre><code>{
"result": {
"uid": "&lt;UID_OF_YOUR_LIVE_INPUT&gt;",
"rtmps": {
"url": "rtmps://live.cloudflare.com:443/live/",
"streamKey": "&lt;PRIVATE_RTMPS_STREAM_KEY&gt;"
},
...
}
}</code></pre>
            
    <div>
      <h3>Step 2: Use the RTMPS key with any live broadcasting software, or in your own native app</h3>
      <a href="#step-2-use-the-rtmps-key-with-any-live-broadcasting-software-or-in-your-own-native-app">
        
      </a>
    </div>
    <p>Copy the RTMPS URL and key, and use them with your live streaming application. We recommend using <a href="https://obsproject.com/">Open Broadcaster Software (OBS)</a> to get started, but any RTMPS or SRT compatible software should be able to interoperate with Stream Live.</p><p>Enter the Stream RTMPS URL and the Stream Key from Step 1:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6s7amxQ54W9Ik3FqA8SttE/e6a73200ca353bb12b077d2bef2ad685/image5-7.png" />
            
            </figure>
    <div>
      <h3>Step 3: Preview your live stream in the Cloudflare Dashboard</h3>
      <a href="#step-3-preview-your-live-stream-in-the-cloudflare-dashboard">
        
      </a>
    </div>
    <p>In the Stream Dashboard, within seconds of going live, you will see a preview of what your viewers will see, along with the real-time connection status of your live stream.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4KwHTeXov4qVK1WDYiEBLS/c46f5276ac6bacdb8aa29a0bd1388903/Screen-Shot-2022-09-21-at-12.34.35-PM.png" />
            
            </figure>
    <div>
      <h3>Step 4: Add live video playback to your website or app</h3>
      <a href="#step-4-add-live-video-playback-to-your-website-or-app">
        
      </a>
    </div>
    <p>Stream your video using our <a href="https://developers.cloudflare.com/stream/viewing-videos/using-the-stream-player/">Stream Player embed code</a>, or use <a href="https://developers.cloudflare.com/stream/viewing-videos/using-own-player/">any video player that supports HLS or DASH</a> — live streams can be played in both websites or native iOS and Android apps.</p><p>For example, on iOS, all you need to do is provide AVPlayer with the URL to the HLS manifest for your live input, which you can find <a href="https://developers.cloudflare.com/stream/stream-live/watch-live-stream/">via the API</a> or in the <a href="https://dash.cloudflare.com/?to=/:account/stream">Stream Dashboard</a>.</p>
            <pre><code>import SwiftUI
import AVKit

struct MyView: View {
    // Change the url to the Cloudflare Stream HLS manifest URL
    private let player = AVPlayer(url: URL(string: "https://customer-9cbb9x7nxdw5hb57.cloudflarestream.com/8f92fe7d2c1c0983767649e065e691fc/manifest/video.m3u8")!)

    var body: some View {
        VideoPlayer(player: player)
            .onAppear() {
                player.play()
            }
    }
}

struct MyView_Previews: PreviewProvider {
    static var previews: some View {
        MyView()
    }
}</code></pre>
            <p>To run a complete example app in XCode, follow <a href="https://developers.cloudflare.com/stream/examples/ios/">this guide</a> in the Stream Developer docs.</p>
    <div>
      <h2>Companies are building whole new video platforms on top of Stream</h2>
      <a href="#companies-are-building-whole-new-video-platforms-on-top-of-stream">
        
      </a>
    </div>
    <p>Developers want control, but most don’t have time to become video experts. And even video experts building innovative new platforms don’t want to manage live streaming infrastructure.</p><p>Switcher Studio's whole business is live video -- their iOS app allows creators and businesses to produce their own branded, multi camera live streams. Switcher uses Stream as an essential part of their live streaming infrastructure. In their own words:</p><blockquote><p><i>“Since 2014, Switcher has helped creators connect to audiences with livestreams. Now, our users create over 100,000 streams per month. As we grew, we needed a scalable content delivery solution. Cloudflare offers secure, fast delivery, and even allowed us to offer new features, like multistreaming. Trusting Cloudflare Stream lets our team focus on the live production tools that make Switcher unique."</i></p></blockquote><p>While Stream Live has been in beta, we’ve worked with many customers like Switcher, where live video isn’t just one product feature, it <b><i>is</i></b> the core of their product. Even as experts in live video, they choose to use Stream, so that they can focus on the unique value they create for their customers, leaving the infrastructure of ingesting, encoding, recording and delivering live video to Cloudflare.</p>
    <div>
      <h2>Start building live video into your website or app today</h2>
      <a href="#start-building-live-video-into-your-website-or-app-today">
        
      </a>
    </div>
    <p>It takes just a few minutes to sign up and start your first live stream, using the Cloudflare Dashboard, with no code required to get started, but <a href="https://developers.cloudflare.com/stream/">APIs</a> for when you’re ready to start building your own live video features. <a href="https://dash.cloudflare.com/?to=/:account/stream">Give it a try</a> — we’re ready for you, no matter the size of your audience.</p> ]]></content:encoded>
            <category><![CDATA[GA Week]]></category>
            <category><![CDATA[General Availability]]></category>
            <category><![CDATA[Cloudflare Stream]]></category>
            <category><![CDATA[Video]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Developers]]></category>
            <guid isPermaLink="false">2E56cHHAs6xh0x5bjlqC9U</guid>
            <dc:creator>Brendan Irvine-Broque</dc:creator>
            <dc:creator>Kyle Boutette</dc:creator>
            <dc:creator>Mickie Betz</dc:creator>
        </item>
    </channel>
</rss>