<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>Cloudflare changelogs | D1</title><description>Cloudflare changelogs for D1</description><link>https://developers.cloudflare.com/changelog/</link><item><title>D1, Workers - D1 can restrict data localization with jurisdictions</title><link>https://developers.cloudflare.com/changelog/post/2025-11-05-d1-jurisdiction/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-11-05-d1-jurisdiction/</guid><description>&lt;p&gt;You can now set a &lt;a href=&quot;https://developers.cloudflare.com/d1/configuration/data-location/&quot;&gt;jurisdiction&lt;/a&gt; when creating a D1 database to guarantee where your database runs and stores data. Jurisdictions can help you comply with data localization regulations such as GDPR. Supported jurisdictions include &lt;code&gt;eu&lt;/code&gt; and &lt;code&gt;fedramp&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A jurisdiction can only be set at database creation time via wrangler, REST API or the UI and cannot be added/updated after the database already exists.&lt;/p&gt;
&lt;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;sh&quot;&gt;&lt;code class=&quot;language-sh&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;npx&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;wrangler@latest&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;d1&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;create&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;db-with-jurisdiction&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;--jurisdiction&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;eu&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code class=&quot;language-plaintext&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;curl -X POST &quot;https://api.cloudflare.com/client/v4/accounts/&amp;#x3C;account_id&gt;/d1/database&quot; \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span&gt;-H &quot;Authorization: Bearer $TOKEN&quot; \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span&gt;-H &quot;Content-Type: application/json&quot; \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span&gt;--data &apos;{&quot;name&quot;: &quot;db-wth-jurisdiction&quot;, &quot;jurisdiction&quot;: &quot;eu&quot; }&apos;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;To learn more, visit D1&apos;s data location &lt;a href=&quot;https://developers.cloudflare.com/d1/configuration/data-location/&quot;&gt;documentation&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 05 Nov 2025 00:00:00 GMT</pubDate><product>D1</product><category>D1</category><category>Workers</category></item><item><title>D1, Workers - D1 automatically retries read-only queries</title><link>https://developers.cloudflare.com/changelog/post/2025-09-11-d1-automatic-read-retries/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-09-11-d1-automatic-read-retries/</guid><description>&lt;p&gt;D1 now detects read-only queries and automatically attempts up to two retries to execute those queries in the event of failures with retryable errors. You can access the number of execution attempts in the returned &lt;a href=&quot;https://developers.cloudflare.com/d1/worker-api/return-object/#d1result&quot;&gt;response metadata&lt;/a&gt; property &lt;code&gt;total_attempts&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;At the moment, only read-only queries are retried, that is, queries containing only the following SQLite keywords: &lt;code&gt;SELECT&lt;/code&gt;, &lt;code&gt;EXPLAIN&lt;/code&gt;, &lt;code&gt;WITH&lt;/code&gt;. Queries containing any &lt;a href=&quot;https://sqlite.org/lang_keywords.html&quot; target=&quot;_blank&quot;&gt;SQLite keyword&lt;/a&gt; that leads to database writes are not retried.&lt;/p&gt;
&lt;p&gt;The retry success ratio among read-only retryable errors varies from 5% all the way up to 95%, depending on the underlying error and its duration (like network errors or other internal errors).&lt;/p&gt;
&lt;p&gt;The retry success ratio among all retryable errors is lower, indicating that there are write-queries that could be retried. Therefore, we recommend D1 users to continue applying &lt;a href=&quot;https://developers.cloudflare.com/d1/best-practices/retry-queries/&quot;&gt;retries in their own code&lt;/a&gt; for queries that are not read-only but are idempotent according to the business logic of the application.&lt;/p&gt;
&lt;starlight-image-zoom-zoomable&gt;&lt;img src=&quot;https://developers.cloudflare.com/_astro/d1-auto-retry-success-ratio.yPw8B0tB_1c6euA.webp&quot; alt=&quot;D1 automatically query retries success ratio&quot;&gt;&lt;/starlight-image-zoom-zoomable&gt;
&lt;p&gt;D1 ensures that any retry attempt does not cause database writes, making the automatic retries safe from side-effects, even if a query causing changes slips through the read-only detection. D1 achieves this by checking for modifications after every query execution, and if any write occurred due to a retry attempt, the query is rolled back.&lt;/p&gt;
&lt;p&gt;The read-only query detection heuristics are simple for now, and there is room for improvement to capture more cases of queries that can be retried, so this is just the beginning.&lt;/p&gt;</description><pubDate>Thu, 11 Sep 2025 00:00:00 GMT</pubDate><product>D1</product><category>D1</category><category>Workers</category></item><item><title>D1, Workers, Workers for Platforms - Automate Worker deployments with a simplified SDK and more reliable Terraform provider</title><link>https://developers.cloudflare.com/changelog/post/2025-06-17-workers-terraform-sdk-api-fixes/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-06-17-workers-terraform-sdk-api-fixes/</guid><description>&lt;h4&gt;Simplified Worker Deployments with our SDKs&lt;/h4&gt;
&lt;p&gt;We&apos;ve simplified the programmatic deployment of Workers via our &lt;a href=&quot;https://developers.cloudflare.com/fundamentals/api/reference/sdks/&quot;&gt;Cloudflare SDKs&lt;/a&gt;. This update abstracts away the low-level complexities of the &lt;code&gt;multipart/form-data&lt;/code&gt; upload process, allowing you to focus on your code while we handle the deployment mechanics.&lt;/p&gt;
&lt;p&gt;This new interface is available in:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/cloudflare/cloudflare-typescript&quot; target=&quot;_blank&quot;&gt;cloudflare-typescript&lt;/a&gt; (4.4.1)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/cloudflare/cloudflare-python&quot; target=&quot;_blank&quot;&gt;cloudflare-python&lt;/a&gt; (4.3.1)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For complete examples, see our guide on &lt;a href=&quot;https://developers.cloudflare.com/workers/platform/infrastructure-as-code&quot;&gt;programmatic Worker deployments&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;The Old way: Manual API calls&lt;/h4&gt;
&lt;p&gt;Previously, deploying a Worker programmatically required manually constructing a &lt;code&gt;multipart/form-data&lt;/code&gt; HTTP request, packaging your code and a separate &lt;code&gt;metadata.json&lt;/code&gt; file. This was more complicated and verbose, and prone to formatting errors.&lt;/p&gt;
&lt;p&gt;For example, here&apos;s how you would upload a Worker script previously with cURL:&lt;/p&gt;
&lt;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;curl&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;https://api.cloudflare.com/client/v4/accounts/&amp;#x3C;account_id&gt;/workers/scripts/my-hello-world-script&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;-X&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;PUT&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;-H&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;Authorization: Bearer &amp;#x3C;api_token&gt;&apos;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;-F&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;metadata={&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;main_module&quot;: &quot;my-hello-world-script.mjs&quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;bindings&quot;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;type&quot;: &quot;plain_text&quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;name&quot;: &quot;MESSAGE&quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;text&quot;: &quot;Hello World!&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;          &lt;/span&gt;&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;compatibility_date&quot;: &quot;$today&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span&gt;};type=application/json&apos;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;-F&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;my-hello-world-script.mjs=@-;filename=my-hello-world-script.mjs;type=application/javascript+module&apos;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;#x3C;&amp;#x3C;&lt;/span&gt;&lt;span&gt;EOF&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;export default {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;async fetch(request, env, ctx) {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;return new Response(env.MESSAGE, { status: 200 });&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;EOF&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h4&gt;After: SDK interface&lt;/h4&gt;
&lt;p&gt;With the new SDK interface, you can now define your entire Worker configuration using a single, structured object.&lt;/p&gt;
&lt;p&gt;This approach allows you to specify metadata like &lt;code&gt;main_module&lt;/code&gt;, &lt;code&gt;bindings&lt;/code&gt;, and &lt;code&gt;compatibility_date&lt;/code&gt; as clearer properties directly alongside your script content. Our SDK takes this logical object and automatically constructs the complex multipart/form-data API request behind the scenes.&lt;/p&gt;
&lt;p&gt;Here&apos;s how you can now programmatically deploy a Worker via the &lt;a href=&quot;https://github.com/cloudflare/cloudflare-typescript&quot; target=&quot;_blank&quot;&gt;&lt;code&gt;cloudflare-typescript&lt;/code&gt; SDK&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;p&gt;JavaScript&lt;/p&gt;&lt;div&gt;  &lt;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;js&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;import &lt;/span&gt;&lt;span&gt;Cloudflare&lt;/span&gt;&lt;span&gt; from &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;cloudflare&quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;import &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;toFile&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt; from &lt;/span&gt;&lt;span&gt;&quot;cloudflare/index&quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;// ... client setup, script content, etc.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;script&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;await&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;client&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;workers&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;scripts&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;update&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;scriptName&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;account_id&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;accountID&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;metadata&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;main_module&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;scriptFileName&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;bindings&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; []&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;files&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;scriptFileName&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;await&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;toFile&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;Buffer&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;scriptContent&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;scriptFileName&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span&gt;type&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&quot;application/javascript+module&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;    &lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;  &lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;TypeScript&lt;/p&gt;&lt;div&gt;  &lt;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;ts&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;import &lt;/span&gt;&lt;span&gt;Cloudflare&lt;/span&gt;&lt;span&gt; from &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&apos;cloudflare&apos;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;import &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;toFile&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt; from &lt;/span&gt;&lt;span&gt;&apos;cloudflare/index&apos;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;// ... client setup, script content, etc.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;script&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;await&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;client&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;workers&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;scripts&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;update&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;scriptName&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;account_id&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;accountID&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;metadata&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;main_module&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;scriptFileName&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;bindings&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; []&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;files&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;scriptFileName&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;await&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;toFile&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;Buffer&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;scriptContent&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;scriptFileName&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span&gt;type&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;application/javascript+module&apos;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;    &lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;  &lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;  
&lt;p&gt;View the complete example here: &lt;a href=&quot;https://github.com/cloudflare/cloudflare-typescript/blob/main/examples/workers/script-upload.ts&quot; target=&quot;_blank&quot;&gt;https://github.com/cloudflare/cloudflare-typescript/blob/main/examples/workers/script-upload.ts&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Terraform provider improvements&lt;/h4&gt;
&lt;p&gt;We&apos;ve also made several fixes and enhancements to the &lt;a href=&quot;https://github.com/cloudflare/terraform-provider-cloudflare&quot; target=&quot;_blank&quot;&gt;Cloudflare Terraform provider&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fixed the &lt;a href=&quot;https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/workers_script&quot; target=&quot;_blank&quot;&gt;&lt;code&gt;cloudflare_workers_script&lt;/code&gt;&lt;/a&gt; resource in Terraform, which previously was producing a diff even when there were no changes. Now, your &lt;code&gt;terraform plan&lt;/code&gt; outputs will be cleaner and more reliable.&lt;/li&gt;
&lt;li&gt;Fixed the &lt;a href=&quot;https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/workers_for_platforms_dispatch_namespace&quot; target=&quot;_blank&quot;&gt;&lt;code&gt;cloudflare_workers_for_platforms_dispatch_namespace&lt;/code&gt;&lt;/a&gt;, where the provider would attempt to recreate the namespace on a &lt;code&gt;terraform apply&lt;/code&gt;. The resource now correctly reads its remote state, ensuring stability for production environments and CI/CD workflows.&lt;/li&gt;
&lt;li&gt;The &lt;a href=&quot;https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/workers_route&quot; target=&quot;_blank&quot;&gt;&lt;code&gt;cloudflare_workers_route&lt;/code&gt;&lt;/a&gt; resource now allows for the &lt;code&gt;script&lt;/code&gt; property to be empty, null, or omitted to indicate that pattern should be negated for all scripts (see routes &lt;a href=&quot;https://developers.cloudflare.com/workers/configuration/routing/routes&quot;&gt;docs&lt;/a&gt;). You can now reserve a pattern or temporarily disable a Worker on a route without deleting the route definition itself.&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;primary_location_hint&lt;/code&gt; in the &lt;a href=&quot;https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/d1_database&quot; target=&quot;_blank&quot;&gt;&lt;code&gt;cloudflare_d1_database&lt;/code&gt;&lt;/a&gt; resource will no longer always try to recreate. You can now safely change the location hint for a D1 database without causing a destructive operation.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;API improvements&lt;/h4&gt;
&lt;p&gt;We&apos;ve also properly documented the &lt;a href=&quot;https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/script_and_version_settings&quot;&gt;Workers Script And Version Settings&lt;/a&gt; in our public OpenAPI spec and SDKs.&lt;/p&gt;</description><pubDate>Thu, 19 Jun 2025 00:00:00 GMT</pubDate><product>D1</product><category>D1</category><category>Workers</category><category>Workers for Platforms</category></item><item><title>D1, Workers - 50-500ms Faster D1 REST API Requests</title><link>https://developers.cloudflare.com/changelog/post/2025-05-30-d1-rest-api-latency/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-05-30-d1-rest-api-latency/</guid><description>&lt;p&gt;Users using Cloudflare&apos;s &lt;a href=&quot;https://developers.cloudflare.com/api/resources/d1/&quot;&gt;REST API&lt;/a&gt; to query their D1 database can see lower end-to-end request latency now that D1 authentication is performed at the closest Cloudflare network data center that received the request. Previously, authentication required D1 REST API requests to proxy to Cloudflare&apos;s core, centralized data centers, which added network round trips and latency.&lt;/p&gt;
&lt;p&gt;Latency improvements range from 50-500 ms depending on request location and &lt;a href=&quot;https://developers.cloudflare.com/d1/configuration/data-location/&quot;&gt;database location&lt;/a&gt; and only apply to the REST API. REST API requests and databases outside the United States see a bigger benefit since Cloudflare&apos;s primary core data centers reside in the United States.&lt;/p&gt;
&lt;p&gt;D1 query endpoints like &lt;code&gt;/query&lt;/code&gt; and &lt;code&gt;/raw&lt;/code&gt; have the most noticeable improvements since they no longer access Cloudflare&apos;s core data centers. D1 control plane endpoints such as those to create and delete databases see smaller improvements, since they still require access to Cloudflare&apos;s core data centers for other control plane metadata.&lt;/p&gt;</description><pubDate>Thu, 29 May 2025 00:00:00 GMT</pubDate><product>D1</product><category>D1</category><category>Workers</category></item><item><title>D1, Workers - D1 Read Replication Public Beta</title><link>https://developers.cloudflare.com/changelog/post/2025-04-10-d1-read-replication-beta/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-04-10-d1-read-replication-beta/</guid><description>&lt;p&gt;D1 read replication is available in public beta to help lower average latency and increase overall throughput for read-heavy applications like e-commerce websites or content management tools.&lt;/p&gt;
&lt;p&gt;Workers can leverage read-only database copies, called read replicas, by using D1 &lt;a href=&quot;https://developers.cloudflare.com/d1/best-practices/read-replication&quot;&gt;Sessions API&lt;/a&gt;. A session encapsulates all the queries from one logical session for your application. For example, a session may correspond to all queries coming from a particular web browser session. With Sessions API, D1 queries in a session are guaranteed to be &lt;a href=&quot;https://developers.cloudflare.com/d1/best-practices/read-replication/#replica-lag-and-consistency-model&quot;&gt;sequentially consistent&lt;/a&gt; to avoid data consistency pitfalls. D1 &lt;a href=&quot;https://developers.cloudflare.com/d1/reference/time-travel/#bookmarks&quot;&gt;bookmarks&lt;/a&gt; can be used from a previous session to ensure logical consistency between sessions.&lt;/p&gt;
&lt;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;ts&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;// retrieve bookmark from previous session stored in HTTP header&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;bookmark&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;request&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;headers&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;get&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&quot;x-d1-bookmark&quot;&lt;/span&gt;&lt;span&gt;) &lt;/span&gt;&lt;span&gt;??&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&quot;first-unconstrained&quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;session&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;env&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;DB&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;withSession&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;bookmark&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;result&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;await&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;session&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;prepare&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;`SELECT * FROM Customers WHERE CompanyName = &apos;Bs Beverages&apos;`&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;run&lt;/span&gt;&lt;span&gt;()&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;// store bookmark for a future session&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;response&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;headers&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;set&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&quot;x-d1-bookmark&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;session&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;getBookmark&lt;/span&gt;&lt;span&gt;() &lt;/span&gt;&lt;span&gt;??&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&quot;&quot;&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Read replicas are automatically created by Cloudflare (currently one in each supported &lt;a href=&quot;https://developers.cloudflare.com/d1/best-practices/read-replication/#read-replica-locations&quot;&gt;D1 region&lt;/a&gt;), are active/inactive based on query traffic, and are transparently routed to by Cloudflare at no additional cost.&lt;/p&gt;
&lt;p&gt;To checkout D1 read replication, deploy the following Worker code using Sessions API, which will prompt you to create a D1 database and enable read replication on said database.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/templates/tree/main/d1-starter-sessions-api&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://deploy.workers.cloudflare.com/button&quot; alt=&quot;Deploy to Cloudflare&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To learn more about how read replication was implemented, go to our &lt;a href=&quot;https://blog.cloudflare.com/d1-read-replication-beta&quot; target=&quot;_blank&quot;&gt;blog post&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Thu, 10 Apr 2025 00:00:00 GMT</pubDate><product>D1</product><category>D1</category><category>Workers</category></item><item><title>D1 - 40-60% Faster D1 Worker API Requests</title><link>https://developers.cloudflare.com/changelog/post/2025-01-07-d1-faster-query/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-01-07-d1-faster-query/</guid><description>&lt;p&gt;Users making &lt;a href=&quot;https://developers.cloudflare.com/d1/&quot;&gt;D1&lt;/a&gt; requests via the &lt;a href=&quot;https://developers.cloudflare.com/d1/worker-api/&quot;&gt;Workers API&lt;/a&gt; can see up to a 60% end-to-end latency improvement due to the removal of redundant network round trips needed for each request to a D1 database.&lt;/p&gt;
&lt;starlight-image-zoom-zoomable&gt;&lt;img src=&quot;https://developers.cloudflare.com/_astro/faster-d1-worker-api.4S7VSUdP_1LmJ72.webp&quot; alt=&quot;D1 Worker API latency&quot;&gt;&lt;/starlight-image-zoom-zoomable&gt;
&lt;p&gt;&lt;em&gt;p50, p90, and p95 request latency aggregated across entire D1 service. These latencies are a reference point and should not be viewed as your exact workload improvement.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This performance improvement benefits all D1 Worker API traffic, especially cross-region requests where network latency is an outsized latency factor. For example, a user in Europe talking to a database in North America. D1 &lt;a href=&quot;https://developers.cloudflare.com/d1/configuration/data-location/#provide-a-location-hint&quot;&gt;location hints&lt;/a&gt; can be used to influence the geographic location of a database.&lt;/p&gt;
&lt;p&gt;For more details on how D1 removed redundant round trips, see the D1 specific release note &lt;a href=&quot;https://developers.cloudflare.com/d1/platform/release-notes/#2025-01-07&quot;&gt;entry&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Tue, 07 Jan 2025 00:00:00 GMT</pubDate><product>D1</product><category>D1</category></item></channel></rss>