Skip to content

perf(platform): store branding logos and favicons at their shown size #5299

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

The organisation's branding logo is shown at 20×20 CSS px in the navigation (services/platform/app/components/logo/tale-logo.tsx:11-18, size-5, width={20} height={20}), yet branding stores the uploaded file as is: up to 2 MB (MAX_IMAGE_SIZE_BYTES, services/platform/backend/domains/branding/service.ts:89) with no limit on its dimensions. The uploaded favicon is stored raw the same way. The branding image route answers with Cache-Control: no-cache, must-revalidate (services/platform/server.ts:1003-1025), so every page load revalidates it, and the pre-auth shell loads it too. A 2 MB logo is about 50 times the width a DPR 2 screen needs for a 20 px slot.

Proposed change

Normalise branding images when they are uploaded: resize the logo to the largest size the product shows it at (DPR 2) and the favicon to the favicon sizes, re-encode them through the shared policy (@tale/ui/images/responsive, @tale/ui/images/encode; sharp is already in the lock files), and keep an SVG as SVG. Consider a validator-based cache (ETag) instead of no-cache alone.

Acceptance criteria

  • A logo or favicon uploaded at any size is stored at the size the product shows it at (DPR 2), within the shared byte budget.
  • SVG uploads keep working.
  • A test pins the stored 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