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): store branding logos and favicons at their shown size #5299
Part of #5251 (the in-app image audit of part 3 of #4686). Claims checked at tale-project/tale24a091dddf6d1d7f81aaaa214cd0523806d8c049 (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.
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