Skip to content
smallPict
Start free
HomeCloud providersCloudflare (R2 & Edge CDN)

No egress fees with Cloudflare R2 and the Anycast CDN

Use Cloudflare R2, S3-compatible object storage with no egress fees. Pair it with Cloudflare's global Anycast CDN to deliver images from the location nearest each visitor, with AVIF or WebP picked automatically for each browser.

BYO-storage & BYO-CDN

Egress cost
$0.00
Global PoPs
300+
Bandwidth savings
Substantial

Infrastructure figures are Cloudflare (R2 & Edge CDN)'s published specifications. Savings from smaller files depend on your images.

Cloudflare (R2 & Edge CDN) + Cloud CDN Integration

How your cloud storage, SmallPict's conversion step and the CDN fit together.

Dedicated storage origin

Cloudflare R2 is S3-compatible object storage with no egress fees, so large media libraries don't bring surprise bandwidth bills.

SmallPict ephemeral engine

SmallPict is an image optimization platform. It picks up image uploads, converts them to AVIF and WebP in memory, strips unneeded EXIF metadata, resizes them, and writes the optimized files straight to your cloud storage bucket.

Global edge CDN delivery

Cloudflare Anycast CDN operates across 300+ cities in 100+ countries, serving cached assets directly from the internet's closest edge with automatic modern format negotiation.

Visual architecture & integration flow

Your images are converted in memory, saved to your bucket and served from the CDN.

  1. 1 · Client / CMS origin

    Upload & interception

    Assets are uploaded via WordPress plugin, web application, or REST API.

  2. 2 · SmallPict ephemeral engine

    Ephemeral optimization

    SmallPict transcodes to AVIF/WebP, resizes dimensions, and strips metadata in isolated, encrypted processing.

  3. 3 · Cloudflare R2 Bucket

    Direct bucket stream

    Optimized files stream straight into your private or public Cloudflare R2 bucket.

  4. 4 · Cloudflare CDN

    Global edge caching

    Cached across global PoPs with immutable 1-year Cache-Control headers.

  5. 5 · End-user browser

    Delivery

    Visitors receive next-gen images from the nearest edge location.

  • Nothing kept on SmallPict servers
  • 1-Year immutable edge cache headers
  • Files stay in your cloud account

How to Connect Cloudflare (R2 & Edge CDN) to SmallPict

A 4-step setup guide to provision buckets, configure least-privilege credentials, connect endpoints, and verify edge delivery.

  1. Provision Dedicated Cloudflare R2 Bucket

    Create a dedicated bucket or container in your Cloudflare (R2 & Edge CDN) console (Standard storage class recommended).

    Tip: Keep the bucket private; public access is not required.

  2. Configure IAM / scoped credentials

    Generate Cloudflare R2 API Token with least-privilege permissions strictly scoped to read and write objects in your bucket.

    Tip: Only PutObject and GetObject permissions are required.

  3. Link endpoint in SmallPict dashboard

    Enter your bucket name, region, endpoint, and API credentials into the SmallPict BYO settings panel.

    Tip: Credentials are encrypted at rest with AES-256 GCM.

  4. Test & verify edge asset delivery

    Upload a test asset or run an automated URL verification. Check response headers for Content-Type: image/avif and CDN cache HIT status.

    Tip: Verify Cache-Control: public, max-age=31536000, immutable.

SmallPict BYO config payload
{
  "provider": "cloudflare_r2",
  "account_id": "7b84310d29184511082c35",
  "bucket": "static-media-vault",
  "cdn_domain": "cdn.yourdomain.com",
  "endpoint": "https://<account_id>.r2.cloudflarestorage.com"
}

Built for scale, traffic surges & media libraries

How different kinds of apps use SmallPict with Cloudflare (R2 & Edge CDN) to handle their images.

E-commerce

E-commerce stores

High-res catalog galleries in Cloudflare R2

Optimize product images, thumbnails, and zoom galleries stored in Cloudflare R2 before global CDN delivery. Speeds up page rendering, reduces bounce rates, and boosts mobile conversion.

Much lighter catalog pages

Media

Media & publishing

Large photo libraries, no restructuring

Convert editorial archives and photography to AVIF or WebP without changing your Cloudflare R2 folder structure.

Simpler editorial workflow

Scale

High-traffic websites

Origin shielding during viral spikes

Shrink asset payloads substantially while keeping Cloudflare (R2 & Edge CDN) as your authoritative origin. Protects storage from excessive bandwidth charges during traffic surges.

Repeat requests answered from the CDN edge

Global

Multi-region applications

Global delivery across continents

Combine multi-region Cloudflare R2 buckets with Anycast CDN edge caching so images load fast for users across the Americas, Europe and Asia.

Served from the edge closest to each visitor

Why Use SmallPict with Cloudflare (R2 & Edge CDN)?

5 strategic architectural advantages designed to eliminate vendor lock-in, reduce latency, and lower operational overhead.

Much lighter

Reduce image payload

Converts PNG and JPEG to AVIF and WebP with no visible quality loss. How much smaller depends on the image.

Your own bucket

Keep your existing storage

Bring your own storage: SmallPict writes straight into your Cloudflare R2 bucket, so your files never move to a closed platform.

Edge delivery

Global edge delivery

Maximize edge cache hit ratios with long-lived immutable cache headers across Cloudflare CDN global points of presence.

Automatic

Automated optimization

Images convert in the background on upload or batch sync. No manual resizing or scripts.

Full control

Infrastructure control

You retain complete ownership, access control policies, IAM boundaries, and compliance governance over your assets.

Ready in 5 mins

Drop-in integration

Connect through the WordPress plugin, the API or the dashboard. No changes to your infrastructure, code or database schema.

Security, privacy & access control

Does SmallPict keep or store copies of my files?

Not when you bring your own storage. Images are processed in isolated, encrypted processing storage, and the optimized files are written straight to your Cloudflare R2 bucket. Your files live in your own account: you keep your originals and are responsible for those copies, and SmallPict does not keep a backup of them.

No copies kept after conversion

Least-privilege IAM

SmallPict requires only bucket-scoped read and write permissions (e.g. PutObject / GetObject). We never request or require administrative, project-wide, or account-wide credentials.

Private bucket support

Your Cloudflare R2 buckets do NOT need to be public. SmallPict writes directly using authenticated API calls, and asset delivery is routed securely via CDN Origin Access Control or signed origins.

AES-256 encryption

All API tokens and credentials stored in SmallPict are encrypted at rest using AES-256 GCM envelope encryption and never logged in plaintext.

Customer sovereignty

The files stay yours. You can revoke credentials or rotate keys at any time in your Cloudflare (R2 & Edge CDN) console.

Supported Configuration for Cloudflare (R2 & Edge CDN)

Verify compatibility across cloud storage tiers, bucket configurations, regional topologies, and edge delivery options.

Configuration & featureSupport statusTechnical details
Cloud object storageSupportedFull native integration with Cloudflare R2
Multi-region bucketsSupportedGeo-redundant storage supported
Regional bucketsSupportedLocal datacenter storage supported
Standard storage classSupportedOptimal performance tier
Edge CDN accelerationSupportedCloudflare CDN delivery
Delivery domainSupportedManaged in your own CDN account
Private bucket supportSupportedOrigin access restriction enabled
Least-privilege scoped credentialsSupportedCloudflare R2 API Token
Immutable cache-control headersSupportedmax-age=31536000, immutable
Automatic AVIF / WebP negotiationSupportedDynamic Accept header support

Image Optimization for Cloudflare (R2 & Edge CDN)

Technical specifications covering AVIF, WebP, compression algorithms, responsive dimensions, and cacheability.

AVIF format

Much smaller than JPEG/PNG

AVIF (AV1) encoding

AVIF uses AV1 keyframe compression, which gives the best quality for its file size of any format browsers support today.

WebP format

Smaller than JPEG/PNG at the same visual quality

Universal modern compatibility

Supported in all current browsers, with alpha transparency kept and perceptual quantization.

Edge caching

1-year edge cache

Immutable cache-control

Automatically attaches public, max-age=31536000, immutable to maximize edge retention.

  • 1-Year immutable CDN edge caching to prevent redundant origin requests
  • Automatic browser format negotiation via HTTP Accept headers
  • Responsive downscaling with srcset width descriptors
  • Faster Largest Contentful Paint (LCP)

Lower egress bills from smaller files

Why optimizing image weight directly lowers your cloud provider monthly invoice without paying inflated SaaS CDN markups.

Without SmallPict (raw media)

Heavy egress bandwidth & slower pages

Raw, unoptimized JPEG/PNG images (2.5MB–5MB each) consume excessive storage and drive heavy outbound egress bandwidth charges from Cloudflare (R2 & Edge CDN).

  • Heavy 2.5MB - 5MB original image weights
  • Full cloud provider egress bandwidth charges
  • Higher LCP latency impacting Google search rankings

With SmallPict + Cloudflare (R2 & Edge CDN)

Lower egress bandwidth bills from your cloud provider

Smaller payloads mean less outbound data transfer, which lowers your cloud provider egress bill every billing cycle.

  • Images served from Cloudflare Global Anycast Edge Network edge locations close to your visitors
  • You pay Cloudflare (R2 & Edge CDN) directly at its own cloud rates, with no markup from a closed image CDN.
  • Year-long cache headers, so the CDN answers repeat requests from the edge

Frequently asked questions

Clear technical answers regarding Cloudflare (R2 & Edge CDN) storage integration, CDN cache headers, security policies, and performance.

What is Cloudflare R2 + Cloudflare CDN Integration?

Cloudflare R2 keeps your files, and Cloudflare CDN serves cached copies from the edge locations closest to your visitors. SmallPict sits in between and compresses images before they are stored and delivered.

Can SmallPict optimize images stored in Cloudflare R2?

Yes. SmallPict connects directly to your Cloudflare R2 buckets. It compresses JPEG, PNG, and WebP assets, converts them to AVIF and WebP, and stores the optimized files directly inside your bucket.

Does SmallPict work with Cloudflare CDN?

Yes. When SmallPict streams optimized images to Cloudflare R2, it attaches long-lived HTTP caching headers (Cache-Control: public, max-age=31536000, immutable). Cloudflare CDN caches these assets at the edge and answers repeat requests from there.

Can I use a private Cloudflare R2 bucket?

Absolutely. SmallPict does NOT require your bucket to be public. SmallPict writes directly using authenticated API calls, and public delivery is handled securely via CDN Origin Access Control or private origin configurations.

Does SmallPict require Cloudflare (R2 & Edge CDN) administrative credentials?

No. SmallPict operates on least-privilege principles and only requires credentials (Cloudflare R2 API Token) with scoped permissions strictly restricted to reading and writing objects within your specific target bucket.

Can I use a multi-region Cloudflare R2 bucket?

Yes. SmallPict fully supports multi-region, dual-region, and regional bucket configurations. SmallPict will push optimized assets to whichever endpoint you configure in your SmallPict dashboard.

Does SmallPict alter or overwrite my original images?

By default, SmallPict generates modern optimized formats (.avif and .webp) alongside your original master files, preserving your original images untouched unless you explicitly configure in-place replacement.

Where are optimized images stored?

All optimized images are stored directly in your own Cloudflare R2 bucket, in your own account. With BYO storage you keep your originals and are responsible for those copies; SmallPict does not keep a backup of them.

Does SmallPict support WebP and AVIF formats?

Yes. SmallPict natively encodes both AVIF and WebP, which are typically much smaller than JPEG. When delivered through Cloudflare CDN, assets are served dynamically according to the visitor's browser support.

How does caching work after image optimization?

SmallPict injects Cache-Control: public, max-age=31536000, immutable headers into every stored asset. This tells Cloudflare CDN edge nodes and client browsers to cache the image for up to one year, so repeat requests rarely reach your origin and origin transfer fees stay low.

Keep your storage, control your egress bill

Deploy SmallPict with Cloudflare (R2 & Edge CDN). Keep your media assets inside your own cloud account while enjoying automated AVIF/WebP encoding and global edge acceleration.