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
🌟 [EPIC] Responsive images #2255
Comments
this is what @roschaefer shared as a possible first step https://github.com/lovell/sharp |
We are migrating the which leverages |
The way I see it we have two approaches on the table right now – each with their advantages and disadvantages: Store one image, resize it on demand (partly implemented by PR #2602)
Store different image sizes, request the required size (partly implemented by PR #2605)
On the frontend we could still use I’m leaning towards the first one because I’m not very comfortable with deciding on any fixed image sizes at this point. But I know @Mogge has more experience in this regard, so I’d be happy to hear your suggestions! Long-term I think the second one would be more efficient, though… 🤷♀ @mattwr18 @roschaefer what do you think? |
Meeting notes (Feb 11th, with @roschaefer, @mattwr18, @Mogge, @ogerly)Two different topics in the backend: Storing imagesWe want to remove the images from our cluster and put them in an object storage. We will probably store them on Digital Ocean's Spaces. It's cheaper than our current solution and allows the backend to scale. Delivering imagesWe want to use a CDN (Content Delivery Network) to deliver images – it works like a cache for the different image sizes that are requested and makes requests faster. Solution no1: The Cloudflare CDN has built-in resizing of images, so it would be an all-in-one solution – but this feature is only available for Enterprise Accounts, so it is expensive. Solution no2: Spaces has a built-in CDN that doesn't include a function for resizing images on the fly, so we can only use it when we decide to store different image sizes. Solution no3: We store the images on Spaces, resize the images on the fly and configure our own CDN. Frontend question: Why use
|
really awesome @alina-beck !!! thank you soo much for taking such good concise notes!! It's very much appreciated. When writing cypress tests for I remember that we just had this discussion and decided. I have just added a check to see if an image is a Question: Does this change anything for anyone? Or do we still want to say as long as it's less than |
I'd say leave the image compression for |
sounds good to me! anyone object? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
not stale |
🌟 EPIC
Steps to implement:
Backend (uploading images)
Webapp (displaying images)
Avatar
component from the styleguide (addressed by PR refactor(styleguide): Migrate Avatar component to monorepo #2700)Card
component from the styleguide 🎨 [Styleguide Migration] Card #2685ResponsiveImage
component that requests the correct image size according to screen size and resolution, and use it inAvatar
andCard
🚀 [Feature] ResponsiveImage component #2860ResponsiveImage
component (maybe already part of 🚀 [Feature] ResponsiveImage component #2860 / addressed by PR feat: responsive images with lazy loading #2801?)A user mentioned me on our network: https://human-connection.social/post/c0c726e7-bdef-45ac-8391-b82d17f125e8/bin-ich-eigentlich-die-einzige#commentId-7fc18102-25cc-452a-8729-7ea269131cc8
English:
I had a look into our network traffic and indeed, our images are quite large. To reprodue:
You will see that some of the avatars are larger than 2MB(!). For example this here:
The avatar is so small that it's barely visible. There is no justification to send more than 2MB over the wire.
User Problem
Especially for mobile browsers it is important to get smaller resolutions of images. You have a bandwith quota and it will exceed quickly. Furthermore, on a slow internet connection, the images will load really slowly, that's what the user is complaining about (see above ☝️).
Implementation
In our legacy alpha, we used https://github.com/thumbor/thumbor. I think it's still a reasonable choice. We would have to change our kubernetes configuration in a way that there is another
thumbor
service which has the persistent volume claim on the uploads folder.Design & Layout
🤷♂️
Validation
You would request a responsive image and get different resolution: https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images
The text was updated successfully, but these errors were encountered: