Activate Dynamic CDN Image Resizing and Optimization on production
We have resolved image HTTP caching on production (see https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/7942). We did already in the past tests on staging with the image optimization of our CDN provider Fastly and it is still activated and works great. The main issue so far was proper caching as otherwise, the CDN would have been resizing all the time.
This should have great impact on performance as we currently load avatars in the original uploaded version (up to 200kb) and the actually needed version would be only 4kb. In the next step, we would also implement image resizing for content (issues, comments, etc.) right now this would be only for avatars of any type.
Related infos
- Implementation in GitLab - gitlab-org/gitlab#22955 (closed)
- Based on fastly image optimization documentation - https://docs.fastly.com/api/imageopto/
- Now needs to be implemented through Cloudflare workers https://developers.cloudflare.com/images/worker/
- Example resized image on staging https://gl-staging.freetls.fastly.net/uploads/-/system/project/avatar/74823/dev_kit_logo.png?width=48
Tasks needed
- Activate Image optimization in CDN for staging and then production through Cloudflare workers.
- Monitor costs? (In reality, this should reduce costs as it is decreasing server impact and Bandwith greatly)
- Test automatic WebP support
Edited by Tim Zallmann