···11+---
22+"@opennextjs/cloudflare": minor
33+---
44+55+feature: optional batch upload for faster R2 cache population
66+77+This update adds optional batch upload support for R2 cache population, significantly improving upload performance for large caches when enabled via .env or environment variables.
88+99+**Key Changes:**
1010+1111+1. **Optional Batch Upload**: Configure R2 credentials via .env or environment variables to enable faster batch uploads:
1212+1313+ - `R2_ACCESS_KEY_ID`
1414+ - `R2_SECRET_ACCESS_KEY`
1515+ - `CF_ACCOUNT_ID`
1616+1717+2. **Automatic Detection**: When credentials are detected, batch upload is automatically used for better performance
1818+1919+3. **Smart Fallback**: If credentials are not configured, the CLI falls back to standard Wrangler uploads with a helpful message about enabling batch upload for better performance
2020+2121+**All deployment commands support batch upload:**
2222+2323+- `populateCache` - Explicit cache population
2424+- `deploy` - Deploy with cache population
2525+- `upload` - Upload version with cache population
2626+- `preview` - Preview with cache population
2727+2828+**Performance Benefits (when batch upload is enabled):**
2929+3030+- Parallel transfer capabilities (32 concurrent transfers)
3131+- Significantly faster for large caches
3232+- Reduced API calls to Cloudflare
3333+3434+**Usage:**
3535+3636+Add the credentials in a `.env`/`.dev.vars` file in your project root:
3737+3838+```bash
3939+R2_ACCESS_KEY_ID=your_key
4040+R2_SECRET_ACCESS_KEY=your_secret
4141+CF_ACCOUNT_ID=your_account
4242+```
4343+4444+You can also set the environment variables for CI builds.
4545+4646+**Note:**
4747+4848+You can follow documentation https://developers.cloudflare.com/r2/api/tokens/ for creating API tokens with appropriate permissions for R2 access.
+27
packages/cloudflare/README.md
···5555 # or
5656 bun opennextjs-cloudflare build && bun opennextjs-cloudflare deploy
5757 ```
5858+5959+### Batch Cache Population (Optional, Recommended)
6060+6161+For improved performance with large caches, you can enable batch upload by providing R2 credentials via .env or environment variables.
6262+6363+Create a `.env` file in your project root (automatically loaded by the CLI):
6464+6565+```bash
6666+R2_ACCESS_KEY_ID=your_access_key_id
6767+R2_SECRET_ACCESS_KEY=your_secret_access_key
6868+CF_ACCOUNT_ID=your_account_id
6969+```
7070+7171+You can also set the environment variables for CI builds.
7272+7373+**Note:**
7474+7575+You can follow documentation https://developers.cloudflare.com/r2/api/tokens/ for creating API tokens with appropriate permissions for R2 access.
7676+7777+**Benefits:**
7878+7979+- Significantly faster uploads for large caches using parallel transfers
8080+- Reduced API calls to Cloudflare
8181+- Automatically enabled when credentials are provided
8282+8383+**Fallback:**
8484+If these environment variables are not set, the CLI will use standard Wrangler uploads. Both methods work correctly - batch upload is simply faster for large caches.