Skip to content

perf: reduce mobile navigation and rendering cost#8

Open
hongding0211 wants to merge 1 commit into
zqqcee:mainfrom
hongding0211:perf/mobile-navigation-rendering
Open

perf: reduce mobile navigation and rendering cost#8
hongding0211 wants to merge 1 commit into
zqqcee:mainfrom
hongding0211:perf/mobile-navigation-rendering

Conversation

@hongding0211

Copy link
Copy Markdown

Summary

This PR reduces mobile rendering pressure and fixes avoidable navigation/cache overhead that made the site feel hot, janky, and slow on phones.

Root causes

  • Internal links used non-trailing-slash URLs, causing extra redirects before static pages loaded.
  • Static hashed assets, fonts, and images were not given long-lived cache headers.
  • Multiple React/Astro islands hydrated on client:load, increasing main-thread work during page load.
  • Mobile rendering had expensive effects: large fixed blurred background, backdrop blur, infinite SVG stroke animations, and BlurFade filters.
  • Matomo script URL returned 404, adding a failed third-party request.
  • The Lottie loading component pulled in a large client dependency and broke SSR during build.

Changes

  • Enable trailingSlash: always and update internal links/redirects to slash URLs.
  • Add Caddy cache headers for static assets and HTML.
  • Defer non-critical hydration from client:load to client:idle / client:visible.
  • Reduce mobile/reduced-motion GPU-heavy effects.
  • Remove the broken Matomo inline script.
  • Replace Lottie loading animation with a lightweight CSS spinner.
  • Fix existing TypeScript/build issues in header scroll handling and comment posting.

Validation

  • pnpm build passes.
  • astro check reports 0 errors.
  • Client comments chunk is significantly smaller after removing Lottie.

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.

1 participant