fix(perf): serve favicon and logo locally instead of remote Zenodo URLs#17
fix(perf): serve favicon and logo locally instead of remote Zenodo URLs#17rain-Brian wants to merge 3 commits into
Conversation
zhmiao
left a comment
There was a problem hiding this comment.
Why are we changing the link from remote to local?
Downscale docs/assets/cat.png from 415x416 to 192x192 and palette-quantize (256 colors, alpha preserved) — a 94% size reduction. 192px is retina-safe for both the favicon and the header logo, which render at 16-48px. Pairs with the remote->local change so the brand image is both same-origin and small instead of a 301KB cross-origin fetch.
Two reasons: (1) it removes a third-party dependency — every page was fetching the favicon + logo from zenodo.org, so the site degrades if Zenodo is slow or down; (2) it let me optimize the asset. The Zenodo file was a 301KB, 415×416 PNG used for both the favicon and the header logo, which only ever render at 16–48px. I vendored the same image locally and downsized it to 192×192 / 17KB (94% smaller, transparency preserved, visually identical at display size). Net: one fewer cross-origin request and ~285KB off every page. It won't single-handedly move the Lighthouse score (LCP/FCP dominate the current 70), but it's a clean, safe win and removes the external dependency. |
|
@rain-Brian , there is a conflict in this pr |
# Conflicts: # mkdocs.yml
What
Vendors the site favicon/logo locally instead of loading them from a remote Zenodo URL on every page.
docs/assets/cat.png(the existing brand icon, copied from the Zenodo record).mkdocs.yml:favicon/logo→assets/cat.png(washttps://zenodo.org/records/15376499/files/cat.png).Why
Every page currently makes a cross-origin request to
zenodo.orgfor the favicon and logo — a render-blocking external dependency and a measurable performance hit (Lighthouse Performance is 70). Serving them locally removes two external requests sitewide and is the cheapest available perf win.Verification
mkdocs build --strictclean; built homepage contains nozenodo.orgreferences;site/assets/cat.pngresolves under/MegaDetector/.