perf(relay): cache macro images (faster display) #11

Merged
jknapp merged 1 commits from perf/relay-image-cache into main 2026-07-18 06:22:09 +00:00
Owner

Relay web client cached images (in-memory + immutable Cache-Control) instead of re-fetching through the proxy on every render.

Relay web client cached images (in-memory + immutable Cache-Control) instead of re-fetching through the proxy on every render.
jknapp added 1 commit 2026-07-18 06:22:07 +00:00
The relay web client re-fetched every macro image through the relay->desktop
proxy on each render (tab switch, WS update) and revoked the object URL on
load, so nothing was reused and fetches were serial — slow to display.

- Client: cache image_path -> Promise<objectURL> and reuse across renders
  (macro images are content-addressed by uuid, so immutable); fetch in
  parallel and de-duplicate concurrent requests.
- Proxy: send Cache-Control: private, max-age=31536000, immutable on image
  responses so the browser also disk-caches them across reloads.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jknapp merged commit e4f0471614 into main 2026-07-18 06:22:09 +00:00
jknapp deleted branch perf/relay-image-cache 2026-07-18 06:22:09 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MacroPad/MP-Server#11