davsclaus opened a new issue, #1879:
URL: https://github.com/apache/camel-website/issues/1879

   ## Description
   
   Measured on the live site (gzipped sizes) and in the repo.
   
   ### highlight.js ships all ~180 languages on every page
   - `antora-ui-camel/src/js/vendor/highlight.bundle.js:2` does 
`require('highlight.js')`, which is the full build. It then registers 9 
languages explicitly, which has no effect.
   - The live `/_/js/vendor/highlight-*.js` is **305 KB gzipped (965 KB raw)**. 
It is loaded on every page, including the home page 
(`layouts/partials/footer.html:61`, 
`antora-ui-camel/src/partials/footer-scripts.hbs:3`).
   
   ### DocSearch JS loads synchronously
   `docsearch-*.js` is 89 KB gzipped (290 KB raw) and is loaded with a plain 
`<script src>` (no `async`/`defer`) on every page.
   
   ### Heavy, unoptimised blog images
   - 68 images in `content/` and `static/` are over 500 KB and 38 are over 1 
MB, about 134 MB in total.
   - The worst are GIFs:
     - `karavan-tour.gif` (15 MB)
     - `karavan-add-to-step.gif` (9.6 MB)
     - `kaoto-release-2.8.0/what-is-new.gif` (9.2 MB)
   - Only 5 webp/avif files exist.
   - There is no image render hook: in the built blog, 0 of 893 `<img>` have 
`loading=` and only 24 have `width`/`height` (those come from the `image` 
shortcode).
   
   ### Dead weight
   - `svg4everybody.js` (an IE11 polyfill) still loads on every page 
(`footer.html:62`, `footer-scripts.hbs:4`).
   - The CSS still declares `.woff` fallbacks next to `.woff2`, and there is no 
`<link rel=preload>` for the main Archivo font face.
   
   ## Proposal
   
   1. **highlight.js:** use `require('highlight.js/lib/core')` and keep the 
explicit registrations. Expected size: roughly 30–50 KB raw. Check that the 
languages used in the docs (java, xml, yaml, json, shell, properties, groovy, 
sql, dockerfile, plus anything else used in practice) are still registered.
   2. **DocSearch:** add `defer`, or lazy-load it on first focus/click of the 
search box or on Ctrl-K.
   3. **Images:**
      - Add `layouts/_default/_markup/render-image.html` that resizes 
page-bundle images to webp/avif, sets `width`/`height` and adds 
`loading="lazy"` (except for the first image).
      - Convert the large GIFs to MP4/WebM `<video autoplay muted loop 
playsinline>`.
      - Optionally add a CI check that flags new images over ~500 KB.
   4. **Cleanup:** drop `svg4everybody` and the `.woff` fallbacks, and preload 
the main font.
   
   ## Additional Context
   
   For reference, current gzipped sizes on the live site:
   
   | Page or file | Size |
   |---|---|
   | Home page | 6.7 KB |
   | `/components/next/` | 35 KB |
   | Kafka component page | 81 KB |
   | `site.css` | 19.6 KB |
   
   The highlight.js bundle alone is larger than all of these combined.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to