Skip to content

fix(perf): serve favicon and logo locally instead of remote Zenodo URLs#17

Open
rain-Brian wants to merge 3 commits into
mainfrom
fix/local-favicon-logo
Open

fix(perf): serve favicon and logo locally instead of remote Zenodo URLs#17
rain-Brian wants to merge 3 commits into
mainfrom
fix/local-favicon-logo

Conversation

@rain-Brian
Copy link
Copy Markdown
Collaborator

What

Vendors the site favicon/logo locally instead of loading them from a remote Zenodo URL on every page.

  • Adds docs/assets/cat.png (the existing brand icon, copied from the Zenodo record).
  • mkdocs.yml: favicon/logoassets/cat.png (was https://zenodo.org/records/15376499/files/cat.png).

Why

Every page currently makes a cross-origin request to zenodo.org for 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 --strict clean; built homepage contains no zenodo.org references; site/assets/cat.png resolves under /MegaDetector/.

@rain-Brian rain-Brian requested a review from zhmiao June 1, 2026 20:01
Copy link
Copy Markdown
Collaborator

@zhmiao zhmiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@rain-Brian
Copy link
Copy Markdown
Collaborator Author

Why are we changing the link from remote to local?

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.

@zhmiao
Copy link
Copy Markdown
Collaborator

zhmiao commented Jun 2, 2026

@rain-Brian , there is a conflict in this pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants