Send resize parameters for avatars
What does this MR do?
- Adds the
width
query string parameter to lazy loaded avatars, so that either our Backend or the CDN can send an accordingly resized image. It tries to use mainly the set width attribute or it will use the rendered width - To make it easier and JS overhead smaller added to the rails universal avatar handler already the query parameter
- Right now we have only the possibility to resize + optimise through the CDN so if no CDN in place to pick it up those parameters will be simply ignored
- It is planned to this as soon as it is on staging with the gitlab.com CDN
I noticed some of the avatars on the page are currently shown without the CDN url so there it won't have any impact, idea is to update those also in a later MR.
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
To make the page load faster
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Conforms to the code review guidelines
-
Has been reviewed by a Frontend maintainer -
Has been reviewed by a Backend maintainer
-
-
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them -
Internationalization required/considered -
End-to-end tests pass ( package-and-qa
manual pipeline job)
What are the relevant issue numbers?
Edited by Mike Greiling