Skip to content

Commit f31e4a3

Browse files
authored
docs(cloudflare): populate cache with r2 bulk put (#194)
1 parent 52297e5 commit f31e4a3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pages/cloudflare/cli.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,20 @@ It first builds the Next.js application by invoking the `build` script of the `p
2222

2323
It populates the configured [Open Next cache components](/cloudflare/caching) so that caching works at runtime. It can populate the local bindings (`populateCache local`) used during development on your local machine or the remote bindings (`populateCache remote`) used by the deployed application. Note that this command is implicitly called by the `preview`, `deploy`, and `upload` commands so there is no need to explicitly call `populateCache` when one of those is used.
2424

25+
<Callout type='info'>
26+
27+
From version 1.13.0 of the Cloudflare adapter, R2 batch uploads are supported out of the box for preview and deploy without any additional setup.
28+
29+
Before version 1.13.0 of the Cloudflare adapter, the `populateCache` command was supporting R2 batch uploads via `rclone` which required the following additional setup:
30+
2531
The `populateCache` command supports R2 batching to speed up the upload of large number of files. To enable R2 batching, you need to create an R2 Account API token as described [in the docs](https://developers.cloudflare.com/r2/api/tokens/) and provide the following environment variables:
2632

2733
- `R2_ACCESS_KEY_ID`: The access key ID of the R2 API token
2834
- `R2_SECRET_ACCESS_KEY`: The secret access key of the R2 API token
2935
- `CLOUDFLARE_ACCOUNT_ID`: The [account ID](https://developers.cloudflare.com/fundamentals/account/find-account-and-zone-ids/#copy-your-account-id) where the R2 bucket is located
3036

37+
</Callout>
38+
3139
### `preview` command
3240

3341
It starts by populating the local cache and then launches a local development server (via `wrangler dev`) so that you can preview the application locally.

0 commit comments

Comments
 (0)