Skip to content

Perf: Optimize GitHub Avatar Sizes #9036

@tobiu

Description

@tobiu

Optimize GitHub avatar image loading by appending the s (size) query parameter to avatar URLs.

Goal: Reduce bandwidth usage by requesting appropriately sized images instead of full-resolution originals.

Changes:

  1. src/component/GitHubUser.mjs:
    • Display size is 32px.
    • Append &s=64 (for 2x DPI) to avatarUrl_.
  2. src/component/GitHubOrgs.mjs:
    • Display size is 20px.
    • Append &s=40 (for 2x DPI) to avatar_url.

Logic:

  • Check if URL already has query parameters (it usually does, e.g., ?v=4).
  • Append &s=SIZE or ?s=SIZE accordingly.

Metadata

Metadata

Assignees

Labels

aienhancementNew feature or requestperformancePerformance improvements and optimizations

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions