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

Optimise image delivery #18

Open
3 tasks
axeltlarsson opened this issue Apr 26, 2020 · 0 comments
Open
3 tasks

Optimise image delivery #18

axeltlarsson opened this issue Apr 26, 2020 · 0 comments
Labels
enhancement New feature or request frontend

Comments

@axeltlarsson
Copy link
Owner

axeltlarsson commented Apr 26, 2020

Progressively load images

Use something like medium.com's progressive image loading, so first load a super-low-res and super-small version of each thumbnail - this should feel instant. But display it with a good blur filter so that it looks good. These images should probably be pre-process so on the server so that they are available without any image processing required on the server side.
Then, in parallel request the "full" resolution of the image (full resolution as in the perfect size for the particular view port), optionally lazily as you scroll down the list. These "full" resolution images can be dynamically requested and thus could trigger a server-side image processing step, that should be ok as it will only be done once on the server - then they'll be saved in the cache on disk.
Then smoothly transition into the full-res images as they downloaded.

Use responsive images

Basically serve the correct image resolution for each device. One alternative is to use srcset
and provide 1x, 2x, 3x etc resolutions, see https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images

Or perhaps use devicePixelRatio directly in Elm/js?

https://developer.mozilla.org/en-US/docs/Web/CSS/image-set

Resources

Todo

  • Progressively load images on Page.RecipeList (and Page.Recipe) with an initial blurred image:
    • either with blurhash,
    • or using vips gaussian blur...
  • Serve responsive images
  • lazy-load Page.RecipeList
@axeltlarsson axeltlarsson added enhancement New feature or request frontend labels Apr 26, 2020
@axeltlarsson axeltlarsson changed the title Lazy-load and blur super-low-res thumbnails in Recipe List Optimise image delivery Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend
Projects
None yet
Development

No branches or pull requests

1 participant