You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browser Rendering can be used with other developer products. You might need a [relational database](/d1/), an [R2 bucket](/r2/) to archive your crawled pages and assets, a [Durable Object](/durable-objects/) to keep your browser instance alive and share it with multiple requests, or [Queues](/queues/) to handle your jobs asynchronous.
47
47
48
-
For the purpose of this guide, you are going to use a [Workers KV store](/kv/concepts/kv-namespaces/) to cache your screenshots.
48
+
For the purpose of this guide, you are going to use [Workers KV](/kv/concepts/kv-namespaces/) to cache your screenshots.
49
49
50
50
Create two namespaces, one for production, and one for development.
Copy file name to clipboardExpand all lines: src/content/docs/data-localization/compatibility.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,6 +139,6 @@ The table below provides a summary of the Data Localization Suite product's beha
139
139
[^31]: DLP is part of Gateway HTTP, however, [DLP datasets](/cloudflare-one/policies/data-loss-prevention/datasets/#use-dlp-datasets) are not available outside US region when using Customer Metadata Boundary.
140
140
[^32]: Dashboard Analytics are empty when using CMB outside the US region. Use Logpush instead.
141
141
[^33]: [Outgoing zone transfers](/dns/zone-setups/zone-transfers/cloudflare-as-primary/) will carry Earth region proxy IPs, thus making regional service dysfunctional when non-Cloudflare nameservers respond to the DNS queries.
142
-
[^34]: Jurisdictional Restrictions (storage) for Workers KV pairs is not supported today.
142
+
[^34]: Jurisdictional Restrictions (storage) for Workers KV is not supported today.
143
143
[^35]: Logs / Analytics not available outside US region when using Customer Metadata Boundary. Jurisdictional Restrictions (storage) options are not supported today.
144
144
[^36]: Only when using a [Custom Domain](/images/manage-images/serve-images/serve-from-custom-domains/) set to a region.
Copy file name to clipboardExpand all lines: src/content/docs/dns/manage-dns-records/how-to/batch-record-changes.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ import { GlossaryTooltip, Example, Render } from "~/components";
10
10
Cloudflare allows you to apply several changes to your zone records in just one action. You can [use the dashboard](#use-the-dashboard) to delete DNS records or update their <GlossaryTooltipterm="proxy status">proxy status</GlossaryTooltip> in bulk, or [use the API](#use-the-api) to perform further batched operations.
11
11
12
12
:::caution[Propagation through the Cloudflare network]
13
-
Although Cloudflare will execute the batched operations in a single [database transaction](https://en.wikipedia.org/wiki/Database_transaction), Cloudflare's distributed KV store must treat each record change as a single key-value pair. This means that the propagation of changes is not atomic. Refer to our [blog post](https://blog.cloudflare.com/batched-dns-changes/) for details.
13
+
Although Cloudflare will execute the batched operations in a single [database transaction](https://en.wikipedia.org/wiki/Database_transaction), Cloudflare's distributed key-value store must treat each record change as a single key-value pair. This means that the propagation of changes is not atomic. Refer to our [blog post](https://blog.cloudflare.com/batched-dns-changes/) for details.
14
14
:::
15
15
16
16
## Availability and limits
@@ -91,7 +91,7 @@ Within each of these four lists, each individual action is executed following th
91
91
### Aspects to consider
92
92
93
93
:::caution[Propagation through the Cloudflare network]
94
-
Although Cloudflare will execute the batched operations in a single [database transaction](https://en.wikipedia.org/wiki/Database_transaction), Cloudflare's distributed KV store must treat each record change as a single key-value pair. This means that the propagation of changes is not atomic. Refer to our [blog post](https://blog.cloudflare.com/batched-dns-changes/) for details.
94
+
Although Cloudflare will execute the batched operations in a single [database transaction](https://en.wikipedia.org/wiki/Database_transaction), Cloudflare's distributed key-value store must treat each record change as a single key-value pair. This means that the propagation of changes is not atomic. Refer to our [blog post](https://blog.cloudflare.com/batched-dns-changes/) for details.
95
95
:::
96
96
97
97
For each operation that you list in the `/batch` request body, consider the required information and how unspecified fields will behave:
Copy file name to clipboardExpand all lines: src/content/docs/durable-objects/api/sql-storage.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ export class MyDurableObject extends DurableObject {
37
37
SQL API methods accessed with `ctx.storage.sql` are only allowed on [Durable Object classes with SQLite storage backend](/durable-objects/reference/durable-objects-migrations/#enable-sqlite-storage-backend-on-new-durable-object-class-migration) and will return an error if called on Durable Object classes with a key-value storage backend.
38
38
:::
39
39
40
-
Specifically for Durable Object classes with SQLite storage backend, KV operations which were previously asynchronous (for example, [`get`](/durable-objects/api/storage-api/#get), [`put`](/durable-objects/api/storage-api/#put), [`delete`](/durable-objects/api/storage-api/#delete), [`deleteAll`](/durable-objects/api/storage-api/#deleteall), [`list`](/durable-objects/api/storage-api/#list)) are synchronous, even though they return promises. These methods will have completed their operations before they return the promise.
40
+
Specifically for Durable Object classes with SQLite storage backend, key-value operations which were previously asynchronous (for example, [`get`](/durable-objects/api/storage-api/#get), [`put`](/durable-objects/api/storage-api/#put), [`delete`](/durable-objects/api/storage-api/#delete), [`deleteAll`](/durable-objects/api/storage-api/#deleteall), [`list`](/durable-objects/api/storage-api/#list)) are synchronous, even though they return promises. These methods will have completed their operations before they return the promise.
Copy file name to clipboardExpand all lines: src/content/docs/kv/api/delete-key-value-pairs.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,7 @@ Calling the `delete()` method will remove the key and value from your Workers KV
70
70
71
71
Delete more than one key-value pair at a time with Wrangler or [via the REST API](/api/operations/workers-kv-namespace-delete-multiple-key-value-pairs).
72
72
73
-
The bulk REST API can accept up to 10,000 KV pairs at once. Bulk writes are not supported using the [Workers KV binding](/kv/concepts/kv-bindings/).
73
+
The bulk REST API can accept up to 10,000 key-value pairs at once. Bulk writes are not supported using the [Workers KV binding](/kv/concepts/kv-bindings/).
74
74
75
75
## Other methods to access Workers KV
76
76
You can also [delete key-value pairs from the command line with Wrangler](/kv/reference/kv-commands/#delete) or [with the REST API](/api/operations/workers-kv-namespace-delete-key-value-pair).
- An object containing the value and the metadata for the requested KV pair. The type of the value attribute will depend on the `type` parameter provided for the `getWithMetadata()` command as follows:
110
+
- An object containing the value and the metadata for the requested key-value pair. The type of the value attribute will depend on the `type` parameter provided for the `getWithMetadata()` command as follows:
111
111
- `text`: A `string` (default).
112
112
- `json`: An object decoded from a JSON string.
113
113
- `arrayBuffer`: An [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance.
Copy file name to clipboardExpand all lines: src/content/docs/kv/api/write-key-value-pairs.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,9 +86,9 @@ Refer to [How Workers KV works](/kv/concepts/how-kv-works/) for more information
86
86
87
87
Write more than one key-value pair at a time with Wrangler or [via the REST API](/api/operations/workers-kv-namespace-write-multiple-key-value-pairs).
88
88
89
-
The bulk API can accept up to 10,000 KV pairs at once.
89
+
The bulk API can accept up to 10,000 key-value pairs at once.
90
90
91
-
A `key` and a `value` are required for each KV pair. The entire request size must be less than 100 megabytes. Bulk writes are not supported using the [Workers KV binding](/kv/concepts/kv-bindings/).
91
+
A `key` and a `value` are required for each key-value pair. The entire request size must be less than 100 megabytes. Bulk writes are not supported using the [Workers KV binding](/kv/concepts/kv-bindings/).
Copy file name to clipboardExpand all lines: src/content/docs/kv/concepts/how-kv-works.mdx
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ Changes are usually immediately visible in the Cloudflare global network locatio
44
44
45
45
Negative lookups indicating that the key does not exist are also cached, so the same delay exists noticing a value is created as when a value is changed.
46
46
47
-
Workers KV does not perform like an in-memory datastore, such as [Redis](https://redis.io). Accessing KV values, even when locally cached, has significantly more latency than reading a value from memory within a Worker script.
47
+
Workers KV does not perform like an in-memory datastore, such as [Redis](https://redis.io). Accessing key-value values, even when locally cached, has significantly more latency than reading a value from memory within a Worker script.
48
48
49
49
## Consistency
50
50
@@ -54,11 +54,10 @@ Visibility of changes takes longer in locations which have recently read a previ
54
54
55
55
:::note
56
56
57
-
Workers KV is not ideal for applications where you need support for atomic operations or where values must be read and written in a single transaction.
58
-
If you need stronger consistency guarantees, consider using [Durable Objects](/durable-objects/).
57
+
Workers KV is not ideal for applications where you need support for atomic operations or where values must be read and written in a single transaction. If you need stronger consistency guarantees, consider using [Durable Objects](/durable-objects/).
59
58
:::
60
59
61
-
An approach to achieve write-after-write consistency is to send all of your writes for a given KV key through a corresponding instance of a Durable Object, and then read that value from KV in other Workers. This is useful if you need more control over writes, but are satisfied with KV's read characteristics described above.
60
+
An approach to achieve write-after-write consistency is to send all of your writes for a given key-value key through a corresponding instance of a Durable Object, and then read that value from Workers KV in other Workers. This is useful if you need more control over writes, but are satisfied with Workers KV's read characteristics described above.
Next, we will create a KV store. This can be done through the Cloudflare dashboard or the Wrangler CLI. For this example, we will use the Wrangler CLI.
58
+
Next, we will create a key-value store. This can be done through the Cloudflare dashboard or the Wrangler CLI. For this example, we will use the Wrangler CLI.
59
59
60
-
To create a KV store via Wrangler:
60
+
To create a key-value store via Wrangler:
61
61
62
62
1. Open your terminal and run the following command:
63
63
@@ -128,20 +128,20 @@ We now have one Workers KV binding that will use the production Workers KV names
128
128
129
129
To store static assets in Workers KV, you can use the Wrangler CLI, the Workers KV binding from a Worker application, or the Workers KV REST API. We will demonstrate how to use the Wrangler CLI.
130
130
131
-
For this scenario, we'll be storing a sample HTML file within our KV store. Create a new file `index.html` in the root of project with the following content:
131
+
For this scenario, we'll be storing a sample HTML file within our key-value store. Create a new file `index.html` in the root of project with the following content:
132
132
133
133
```html title="index.html"
134
134
Hello World!
135
135
```
136
136
137
-
We can then use the following Wrangler commands to create a KV pair for this file within our production and preview namespaces:
137
+
We can then use the following Wrangler commands to create a key-value pair for this file within our production and preview namespaces:
This will create a KV pair with the filename as key and the file content as value, within the our production and preview namespaces specified by your binding in your `wrangler.toml` file.
144
+
This will create a key-value pair with the filename as key and the file content as value, within the our production and preview namespaces specified by your binding in your `wrangler.toml` file.
145
145
146
146
## 4. Serve static assets from Workers KV from your Worker application
147
147
@@ -180,7 +180,7 @@ export default {
180
180
mimeType +="; charset=utf-8";
181
181
}
182
182
183
-
//get the value from the KV store and return it if found
183
+
//get the value from the key-value store and return it if found
This code will use the path within the URL and find the file associated to the path within the KV store. It also sets the proper MIME type in the response to indicate to the browser how to handle the response. To retrieve the value from the KV store, this code uses `arrayBuffer` to properly handle binary data such as images, documents, and video/audio files.
200
+
This code will use the path within the URL and find the file associated to the path within the key-value store. It also sets the proper MIME type in the response to indicate to the browser how to handle the response. To retrieve the value from the key-value store, this code uses `arrayBuffer` to properly handle binary data such as images, documents, and video/audio files.
201
201
202
202
To start the Worker, run the following within a terminal:
203
203
@@ -218,7 +218,7 @@ Your worker has access to the following bindings:
218
218
[wrangler:inf] Ready on http://localhost:<PORT>
219
219
```
220
220
221
-
Access the URL provided by the Wrangler command as such `http://localhost:<PORT>/index.html`. You will be able to see the returned HTML file containing the file contents of our `index.html` file that was added to our KV store. Try it out with an image or a document and you will see that this Worker is also properly serving those assets from Workers KV.
221
+
Access the URL provided by the Wrangler command as such `http://localhost:<PORT>/index.html`. You will be able to see the returned HTML file containing the file contents of our `index.html` file that was added to our key-value store. Try it out with an image or a document and you will see that this Worker is also properly serving those assets from Workers KV.
222
222
223
223
## 5. Create an endpoint to generate dynamic responses from your key-value pairs
224
224
@@ -344,7 +344,7 @@ export default {
344
344
mimeType +="; charset=utf-8";
345
345
}
346
346
347
-
//get the value from the KV store and return it if found
347
+
//get the value from the key-value store and return it if found
This new code provides a specific endpoint, `/hello-world`, which will provide translated responses. When this URL is accessed, our Worker code will first retrieve the language that is requested by the client in the `Accept-Language` request header and the translations from our KV store for the `hello-world.json` key. It then gets the translated message and returns the generated HTML.
364
+
This new code provides a specific endpoint, `/hello-world`, which will provide translated responses. When this URL is accessed, our Worker code will first retrieve the language that is requested by the client in the `Accept-Language` request header and the translations from our key-value store for the `hello-world.json` key. It then gets the translated message and returns the generated HTML.
365
365
366
366
```sh
367
367
npx wrangler dev --remote
@@ -379,7 +379,7 @@ npx wrangler deploy
379
379
380
380
Wrangler will automatically set your Workers KV binding to use the production Workers KV namespace set in our `wrangler.toml` file with the Workers KV namespace id. Throughout this example, we uploaded our assets to both the preview and the production Workers KV namespaces.
381
381
382
-
We can now verify that our project is properly working by accessing our Workers default hostname and accessing `<WORKER-SUBDOMAIN>.<DEFAULT-ACCOUNT-HOSTNAME>.dev/index.html` or `<WORKER-SUBDOMAIN>.<DEFAULT-ACCOUNT-HOSTNAME>.dev/hello-world` to see our deployed Worker in action, generating responses from the values in our KV store.
382
+
We can now verify that our project is properly working by accessing our Workers default hostname and accessing `<WORKER-SUBDOMAIN>.<DEFAULT-ACCOUNT-HOSTNAME>.dev/index.html` or `<WORKER-SUBDOMAIN>.<DEFAULT-ACCOUNT-HOSTNAME>.dev/hello-world` to see our deployed Worker in action, generating responses from the values in our key-value store.
0 commit comments