Skip to content

Commit ee57bf2

Browse files
authored
docs(cloudflare): Document how to enable R2 cache batch uploads (#189)
1 parent b044007 commit ee57bf2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pages/cloudflare/cli.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ 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+
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:
26+
27+
- `R2_ACCESS_KEY_ID`: The access key ID of the R2 API token
28+
- `R2_SECRET_ACCESS_KEY`: The secret access key of the R2 API token
29+
- `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
30+
2531
### `preview` command
2632

2733
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)