Menu

WebP and AVIF Image Thumbnail Recovery — Safe File Naming in Object Storage
📰

WebP and AVIF Image Thumbnail Recovery — Safe File Naming in Object Storage

DEV Community: backend·SullivanReed1247·11 days ago
#73IAFg2n
#devtobackend#devto#dev#object#generation
Reading 0:00
15s threshold

Short answer: use an immutable key per upload and per derivative size, keep the original under a generation prefix, and copy it to an archive key before generating thumbnails. Object storage is a good fit for ordinary e-commerce image delivery; it is a poor fit when recovery from an accidental overwrite or strict writer concurrency is the primary requirement.

That decision is less about WebP versus AVIF than about who owns the write boundary. My rule is simple: the database owns the current image manifest, while the bucket stores immutable bytes. A product image might be represented as products/sku-1842/01c8f7/original.jpg , with derivatives such as .../webp/640.webp and .../avif/1280.avif . The upload id (or content hash) makes each generation distinct.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.