⚡ Bolt: [performance improvement] Preload LCP and Preconnect Fonts#37
⚡ Bolt: [performance improvement] Preload LCP and Preconnect Fonts#37Mitesh411 wants to merge 1 commit into
Conversation
* Preloaded the LCP hero background image (`assets/img/hero-bg.jpg`) in `index.html`. * Added `preconnect` resource hints for Google Fonts (`fonts.googleapis.com` and `fonts.gstatic.com`) in both `index.html` and `portfolio-details.html`. Co-authored-by: Mitesh411 <6998472+Mitesh411@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24ec56dca1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <link rel="preconnect" href="https://fonts.googleapis.com"> | ||
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
There was a problem hiding this comment.
Allow font origins in CSP before adding preconnect
These new preconnect hints are ineffective on index.html because the page’s CSP is default-src 'self' (line 61), so cross-origin connections to fonts.googleapis.com/fonts.gstatic.com are blocked by policy fallback. In this context, the added links do not provide the intended latency win and instead add extra CSP violation noise on every page load; update CSP (for example via connect-src) alongside this optimization.
Useful? React with 👍 / 👎.
💡 What:
<link rel="preload" as="image" href="assets/img/hero-bg.jpg">toindex.html.<link rel="preconnect" href="https://fonts.googleapis.com">and<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>to bothindex.htmlandportfolio-details.html.🎯 Why:
hero-bg.jpgis the Largest Contentful Paint (LCP) element on the homepage. Preloading it ensures the browser starts fetching it immediately, rather than waiting to discover it in the CSS file.📊 Impact:
index.htmlas the main hero image is fetched earlier.🔬 Measurement:
hero-bg.jpg.PR created automatically by Jules for task 11985127944048036046 started by @Mitesh411