Радар на почту

Хранение миниатюр аватаров: приватные оригиналы, фиксированные обрезки и безопасное удаление

DEV · 17.11.2026 · 00:57

В процессе работы с аватарами важно сохранить оригинал в приватности и установить четкий срок удаления производных изображений. Решение включает в себя хранение одного неизменяемого…

Читать в источнике

Оригинал

Avatar Thumbnail Storage: Private Originals, Fixed Crops, and Safe Deletion

An avatar pipeline has one constraint that changes every storage decision: the original must remain private, while each derived image needs a clear deletion deadline. Short answer: keep one immutable-looking original key plus a small set of fixed crops, record every key in the user row, and presign reads only when a client needs them. Sharp does the pixels; your database owns the lifecycle decision. The before/after mental model is simple. Before, a request downloads a giant source image and re