Optimize the size of compiled markdown files
Related to gitlab#214164 (closed)
Problem
The compiled GitLab documentation consumes too much space to be used in Omnibus. In total - 607M.
> cd gitlab-docs
> du -h -d 1 public/ee
607M public/ee
However, the original size of markdown files with images takes ~10 times less space (67M).
> cd gitlab
> du -h -d 1 docs
67M doc
Only markdown files without images
20M doc
We want to reduce the size of compiled files before we can include them in the Omnibus installation.
Ideas
!1291 (merged)
Change the sidebar elements rendering -I did a quick research and found that navigation sidebar code contributes to ~66% of the file size. It happens because we render all sidebar categories and sub-categories even if they are not visible on the page by default.
I want to explore an option to render only necessary sidebar elements. It should significantly reduce size. The drawback is that you won't be able to show/collapse sidebar categories without making an HTTP request.
!1304 (merged)
Use symlinks to image files rather than create a copy of the image -It should reduce the size of images in the compiled version by 100%.
!1305 (closed)
Create only gzip'ed versions -Nginx can automatically decompress these files for clients that don't support gzip encoded responses.
!1295 (merged)
Include icons.svg instead of inlining it -Currently, every generated page has an inlined svg definition that contributes to the total size.