Mercari Engineering
Read post

Legacy Image Provider to Cloudflare Images: Traffic Estimation and Safe Rollout

Mercari's Platform Network team shares how they migrated a legacy image transformation pipeline to Cloudflare Images while keeping existing URLs intact. Key challenges included TLS/SSL issues with legacy S3 bucket naming conventions, egress cost estimation due to Cloudflare's different compression behavior (WebP files up to 50% larger), and zero-downtime rollout mechanics. They resolved S3 access via host-header-style routing with Terraform, validated image quality through pixel-level comparison and adjusted quality settings, estimated costs using 30-day APPROX_COUNT_DISTINCT queries on access logs, and rolled out traffic gradually using regex-based image ID matching (from 0.1% to 100%) with a three-phase cache rebuild strategy to avoid S3 rate limit overloads.

    #aws-s3
Yesterday•10m read time•From engineering.mercari.com
Post cover image
Table of contents
AbstractWhat the migration looked likeMigration challengesHow we resolved it: S3 access from CloudflareHow we resolved it: image quality, egress and costHow we resolved it: zero-downtime rollout detailsConclusion
124 Impressions
Mercari Engineering's image
Mercari Engineering

Mercari's platform is a resource for developers and technology enthusiasts, offering insights into e...

29 Followers

•

369 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard