-
Notifications
You must be signed in to change notification settings - Fork 130
Add an rclone based option to populate the R2 cache #1116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
grabmateusz
wants to merge
10
commits into
opennextjs:main
from
grabmateusz:task/recover-rclone-to-bypass-account-rate-limits
Closed
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f5eee95
Recover #925 PR concept for projects with huge R2 incremental cache
grabmateusz 89293a6
Update Changeset to reflect changes against current main branch
grabmateusz f861f31
Fix formatting
grabmateusz 4f6a0ab
Fix comment
grabmateusz 9004a4a
Fix all remarks to PR
grabmateusz 174547c
changeset updated
grabmateusz 58f6d40
Apply suggestion from @vicb
grabmateusz 4e82fe2
Fix remarks to PR
grabmateusz d07c4ec
Add warning about potential lack of support on all the platforms
grabmateusz def3d3b
fixup! updates
vicb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| --- | ||
| "@opennextjs/cloudflare": minor | ||
| --- | ||
|
|
||
| feature: optional batch upload via rclone for fast R2 cache population that bypasses Account Level Rate Limits | ||
|
|
||
| This update recovers optional opt in for batch upload support for R2 cache population via rclone, which bypasses Account Level Rate Limits. | ||
|
grabmateusz marked this conversation as resolved.
Outdated
|
||
|
|
||
| **Key Changes:** | ||
|
|
||
| 1. **Optional Batch Upload**: Configure R2 credentials via .env or environment variables to opt in to rclone based batch uploads: | ||
|
grabmateusz marked this conversation as resolved.
Outdated
|
||
|
|
||
| - `R2_ACCESS_KEY_ID` | ||
| - `R2_SECRET_ACCESS_KEY` | ||
| - `CF_ACCOUNT_ID` | ||
|
|
||
| 2. **Automatic Detection**: When credentials are detected, batch upload is automatically used | ||
|
|
||
| 3. **Smart Fallback**: If credentials are not configured, the CLI falls back to standard Wrangler uploads with a helpful message about enabling batch upload to bypass Account Level Rate Limits | ||
|
|
||
| **Benefits (when batch upload is enabled):** | ||
|
|
||
| - Parallel transfer capabilities (32 concurrent transfers) | ||
| - Reduced API calls to Cloudflare | ||
| - Bypassing Account Level Rate Limits | ||
|
|
||
| **Usage:** | ||
|
|
||
| Add the credentials in a `.env`/`.dev.vars` file in your project root: | ||
|
|
||
| ```bash | ||
| R2_ACCESS_KEY_ID=your_key | ||
| R2_SECRET_ACCESS_KEY=your_secret | ||
| CF_ACCOUNT_ID=your_account | ||
| ``` | ||
|
|
||
| You can also set the environment variables for CI builds. | ||
|
|
||
| **Note:** | ||
|
|
||
| You can follow documentation https://developers.cloudflare.com/r2/api/tokens/ for creating API tokens with appropriate permissions for R2 access. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.