You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(platform): serve product image thumbnails instead of originals #5300
Part of #5251 (the in-app image audit of part 3 of #4686). Claims checked at tale-project/tale24a091dddf6d1d7f81aaaa214cd0523806d8c049 (feature-train).
What happens
Product images are shown small: the product list cell renders them at width={80} height={80} and the hover card at 128×128 (services/platform/app/features/products/components/product-image.tsx:31-55). Each loads the original upload, which may be up to 5 MB (PRODUCT_IMAGE_MAX_BYTES, services/platform/lib/shared/product-images.ts:4), served by services/platform/backend/domains/products/routes.ts with cache-control: private, no-store, so a product list downloads every original again on each visit.
Proposed change
Store a thumbnail beside each product image when it is uploaded (or derive it on first read), sized for the 128 px hover card at DPR 2, and point the list and the hover card at it; keep the original for the product's own view and for exports. sharp is already in the lock files; the shared policy (@tale/ui/images/responsive, @tale/ui/images/encode) holds format and budget. Revisit no-store for the thumbnail, which carries no more than the list already shows.
Acceptance criteria
The product list and its hover card load a variant no wider than twice their CSS size.
Products whose image predates the change still render.
Activity
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card
perf(ui): size readme tiles, video posters and the social card