Enterprise Edge Delivery with Cloudflare

300+ Points of Presence, tag-based cache purge, Cloudflare for SaaS custom hostnames with auto SSL, Workers integration β€” plus a generous free tier.

Why Cloudflare?

🌍

300+ Global PoPs

The largest CDN network in the world. Edge nodes in virtually every country.

🏷️

Tag-Based Purge

Surgically invalidate groups of images by source, type, or any custom tag β€” without purging unrelated content. (Enterprise)

πŸ”

Cloudflare for SaaS

Auto-provision SSL certificates for customer vanity domains. Perfect for multi-tenant platforms.

⚑

Workers Integration

Optional edge compute for request routing, header manipulation, and A/B testing at the edge.

How It Works

Client β†’ Cloudflare Edge (300+ PoPs)
            ↓ cache miss
         Tiered Cache (regional shield)
            ↓ cache miss
         Image Foundry Origin
            ↓
         Process image (sharp/libvips) β†’ Disk Cache
            ↓
         Response with Cache-Control, ETag,
         Vary: Accept, Cache-Tag headers

Cache Purging β€” 3 Strategies

MethodEndpointPlan Required
URL purge (30/batch)DELETE /api/cdn/purgeAll plans
Tag-based purgeDELETE /api/cdn/purge-tagsEnterprise
Full zone purgeDELETE /api/cdn/purge-allAll plans

Image Foundry automatically batches large URL purge requests into 30-URL chunks to comply with Cloudflare's API limits.

Custom Hostnames via Cloudflare for SaaS

Let your customers use their own domain β€” img.acme.com β€” with automatic SSL:

# 1. Register the hostname
POST /api/cdn/custom-hostname
{ "hostname": "img.acme.com" }

# 2. Customer adds DNS records:
#    CNAME: img.acme.com β†’ proxy.imgfoundry.io
#    TXT:   _cf-custom-hostname.img.acme.com β†’ verification-token

# 3. Verify SSL status
GET /api/cdn/custom-hostname/img.acme.com/verify
β†’ { "status": "active", "ssl": { "status": "active" } }

Recommended Cloudflare Settings

SettingRecommendedWhy
Proxy (orange cloud)βœ“ EnabledRoutes traffic through Cloudflare edge
Cache Everything ruleβœ“ Create ruleCloudflare won't cache dynamic routes by default
Tiered Cacheβœ“ EnabledReduces origin hits via regional shielding
Polishβœ— DisabledImage Foundry handles all optimisation
Mirageβœ— DisabledConflicts with URL-based transformations
HTTP/3βœ“ EnabledFastest transport for image delivery

Cloudflare vs Bunny CDN

FeatureCloudflareBunny CDN
PoPs300+197+
PricingPlan-based (free tier)Per-GB ($0.01+)
Tag-based purgeβœ“ (Enterprise)βœ—
URL-based purgeβœ“ (30/batch)βœ“
Custom hostnamesβœ“ (for SaaS)βœ“ (free SSL)
Perma-Cacheβœ—βœ“
Free planβœ“ Generousβœ— Trial only

Deploy Behind Cloudflare in Minutes

Add your zone, enable proxy, configure caching β€” done.

Get Started Free Read the Docs