Skip to content

perf(search): improve initialization and prefetching logic#1899

Merged
chenjiahan merged 4 commits intomainfrom
search_init_0302
Mar 2, 2025
Merged

perf(search): improve initialization and prefetching logic#1899
chenjiahan merged 4 commits intomainfrom
search_init_0302

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

For large sites, initializing the search while the page is idle may cause the page to render slowly.

To address this issue, this PR splits search init into two steps: prefetch and init:

  • prefetch the search index when the page is idle
  • init the search when the search bar is focused.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 2, 2025

Deploy Preview for aquamarine-blini-95325f ready!

Name Link
🔨 Latest commit de28015
🔍 Latest deploy log https://app.netlify.com/sites/aquamarine-blini-95325f/deploys/67c42c4ca6daa200087a978a
😎 Deploy Preview https://deploy-preview-1899--aquamarine-blini-95325f.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 93 (🟢 up 12 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 2, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit de28015
🔍 Latest deploy log https://app.netlify.com/sites/rspress-v2/deploys/67c42c4c90586b0008fa9d33
😎 Deploy Preview https://deploy-preview-1899--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@chenjiahan chenjiahan requested a review from SoonIter March 2, 2025 09:32
Copy link
Copy Markdown
Member

@SoonIter SoonIter left a comment

Choose a reason for hiding this comment

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

not the real perf😂, just UX perf

@chenjiahan chenjiahan merged commit ece39f1 into main Mar 2, 2025
@chenjiahan chenjiahan deleted the search_init_0302 branch March 2, 2025 10:58
@chenjiahan chenjiahan mentioned this pull request Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants