Skip to content

perf(platform): serve product image thumbnails instead of originals #5300

Open

Description

@tale-code-bot

Part of #5251 (the in-app image audit of part 3 of #4686). Claims checked at tale-project/tale 24a091dddf6d1d7f81aaaa214cd0523806d8c049 (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.
  • A test pins the variant size.

Activity

  1. added
    perf
    agent-ready
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyperf

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions