| 开发者 | devsyed |
|---|---|
| 更新时间 | 2026年11月11日 07:27 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
<picture> output with AVIF and WebP sources.wp-config.php instead of the database, which is the recommended production setup:
define( 'R2CLOUDER_PROVIDER', 'r2' ); // r2, s3, spaces or gcs
define( 'R2CLOUDER_ACCOUNT_ID', '...' ); // r2 only
define( 'R2CLOUDER_REGION', 'us-east-1' ); // AWS region or Spaces datacenter
define( 'R2CLOUDER_ACCESS_KEY', '...' );
define( 'R2CLOUDER_SECRET_KEY', '...' );
define( 'R2CLOUDER_BUCKET', '...' );
define( 'R2CLOUDER_PUBLIC_URL', 'https://cdn.example.com' );
define( 'R2CLOUDER_CF_PROVISIONING_TOKEN', '...' );
define( 'R2CLOUDER_CF_API_TOKEN', '...' );
The recommended setup accepts one Cloudflare token with Workers R2 Storage Write. OffloadKit can create or select the bucket, derive the S3 credentials, and configure delivery. Zone Read is optional for automatic custom-domain discovery; Cache Purge is optional for purge-by-URL. Manual bucket-scoped credentials remain available under Advanced.
DigitalOcean Spaces uses the selected datacenter endpoint (for example https://nyc3.digitaloceanspaces.com). Google Cloud Storage uses https://storage.googleapis.com with HMAC interoperability keys, not service-account JSON credentials. Configure a public delivery URL or CDN separately. Managed bucket migration supports R2 and AWS S3 only.
Cloudflare® and Cloudflare R2 are trademarks of Cloudflare, Inc. This plugin is not affiliated with, endorsed by, or sponsored by Cloudflare, Inc.
DigitalOcean onboarding can create a new Standard Storage bucket using a Full access Spaces key, or connect an existing bucket. New buckets are private unless you explicitly allow public object reads. OffloadKit prefills the new bucket delivery URL; CDN configuration remains in DigitalOcean. Existing bucket policies are not modified.
A Cloudflare account is needed only for R2. AWS S3 and DigitalOcean Spaces use their own accounts and credentials. For R2, setup can create or connect a bucket and configure delivery; manual bucket credentials are also supported.
The pull-back command restores recorded source files to their local WordPress paths. It retains offload metadata if a required download or metadata update fails so you can investigate and retry. Keep independent backups; a missing remote object cannot be recovered without another copy.
Managed bucket migration supports R2 and AWS S3. Cloudflare Slurper can skip zero-byte objects during S3-to-R2 migration; OffloadKit's destination verification then refuses cutover rather than accepting an incomplete transfer. Automatic repair of skipped empty objects is not available. R2-to-S3 migration requires AWS DataSync and the necessary IAM permissions; this direction has not completed live acceptance testing. Keep source objects and independent backups, and verify migration with a separate test bucket before using it for production media.
Private storage delivery supports signed URLs, but it does not implement membership or purchase authorization. WooCommerce and Easy Digital Downloads protected paths are excluded from new offloads, including forced offloads. Existing cloud copies are not automatically made private or removed; audit any previously offloaded protected content. Do not use public media delivery as an access-control system. Private signed URLs expire. Exclude pages and REST responses containing signed media URLs from external full-page, reverse-proxy and CDN caches, and regenerate URLs for each request. OffloadKit sends private/no-store response headers, but external caches must respect those headers. A cached page can otherwise retain an expired URL or share a valid URL with another visitor. Legacy offload records without provider identity need an ownership audit before switching providers.