Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): Lazy load thumbnails on the people page #5356

Merged
merged 2 commits into from Nov 28, 2023

Conversation

l0nax
Copy link
Contributor

@l0nax l0nax commented Nov 28, 2023

My browser freezes for a short amount of time when I open the people page (approx. 600+ non-hidden faces).
I managed to reproduce this behavior every time with

  • Google Chrome
  • Thorium (Chromium)
  • Firefox

This PR ensures that the thumbnails are lazy loaded with the native loading property, which has been supported for a while and thus should not cause any problems.
To prevent increasing the LCP, the first 20 images are eagerly loaded (approx. amount of images shown on a 1920x1080 display).

Instead of loading all people thumbnails at once, only the first few
should be loaded eagerly.
This reduces the load on client and server side.
@l0nax l0nax force-pushed the lazy-load-people-thumbnails branch from 86f58e8 to 9613635 Compare November 28, 2023 12:55
@l0nax l0nax requested a review from bo0tzz November 28, 2023 12:55
Copy link
Contributor

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Maybe the prop could be "preload" instead of "priority"

@alextran1502 alextran1502 enabled auto-merge (squash) November 28, 2023 20:19
@alextran1502 alextran1502 merged commit 5781ae9 into immich-app:main Nov 28, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants