Skip to content

Conversation

@garbas
Copy link
Contributor

@garbas garbas commented Dec 11, 2025

Summary

Comprehensive performance optimizations that improve Lighthouse score from 84/100 to 91/100, with a focus on eliminating render-blocking resources and optimizing image delivery.

Key Improvements

Performance Score: 84/100 → 91/100

CSS & Font Optimization

  • Inlined style.css (11.4 KB) to eliminate 700ms render-blocking request
  • Reduced font declarations from 18 weights to 3 critical (Geist 400/700, Geist Mono 400)
  • Added font preloading with fetchpriority="high" for instant discovery
  • Pico CSS remains external for caching benefits

Image Optimization

  • Added explicit width/height attributes to all images for CLS: 0 (perfect)
  • Implemented responsive images with srcset for background images
  • Mobile savings: 142 KB through appropriately-sized image delivery
  • Added hero image preload and fetchpriority="high" for LCP optimization
  • Maintains full responsive design with CSS max-width: 100%; height: auto;

Developer Experience

  • Added just generate-responsive-images command for reproducible asset generation
  • Updated documentation in CLAUDE.md and README.md with optimization rationale
  • Automated responsive image creation (480w, 768w, 1024w + WebP conversion)

Performance Metrics

  • Performance: 91/100 (↑ from 84/100)
  • Critical Path Latency: 11ms
  • CLS: 0 (perfect - no layout shifts)
  • Mobile Image Savings: 142 KB
  • Accessibility: 100/100
  • Best Practices: 100/100
  • SEO: 100/100

Files Changed

  • index.html: CSS inlining, font optimization, image dimensions, responsive images
  • assets/css/style.css: Removed (now inlined)
  • assets/images/: Added 12 responsive image variants (480w, 768w, 1024w)
  • Justfile: Added responsive image generation command
  • CLAUDE.md & README.md: Updated performance documentation

garbas and others added 5 commits December 11, 2025 14:25
Changed Google Analytics loading strategy to prioritize critical content:
- Load gtag.js after window.onload event (when page is fully loaded)
- Add 1-second delay to ensure page is fully interactive first
- Dynamically inject script to avoid blocking initial parse

Benefits:
- Doesn't compete with critical resources during initial load
- Prioritizes user-facing content
- Analytics still collects data (just slightly deferred)
- Better First Contentful Paint and user experience

Performance maintained:
- Performance: 86/100
- Accessibility: 100/100
- Best Practices: 100/100
- SEO: 100/100

Note: Google Analytics shows as "unused JavaScript" (56KB) in Lighthouse
because it's a large third-party library with features we don't use.
This is expected and acceptable for analytics tracking.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Change from listing individual lighthouse report files to a single
wildcard pattern that catches all lighthouse-* files.

Pattern: /lighthouse-*

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…e images

Major performance improvements to achieve 91/100 Lighthouse score:

- Inline style.css (11.4 KB) to eliminate 700ms render-blocking request
- Reduce fonts from 18 weights to 3 critical (Geist 400/700, Geist Mono 400)
- Add font preloading with fetchpriority="high" for instant discovery
- Add explicit image dimensions to prevent layout shifts (CLS: 0)
- Implement responsive images with srcset for 142 KB mobile savings
- Add fetchpriority="high" and preload for hero image (LCP optimization)
- Maintain full responsive design with CSS max-width rules

Results:
- Performance: 84/100 → 91/100
- Critical path latency: 11ms
- CLS: 0 (perfect)
- Mobile image savings: 142 KB
Add 'just generate-responsive-images' command to automate creation of
responsive image variants (480w, 768w, 1024w) for background images.

The command:
- Generates multiple sizes using sips
- Optimizes PNGs with pngquant + optipng
- Converts to WebP format for better compression
- Outputs file size summary

This ensures responsive images can be regenerated consistently as
assets are updated, maintaining the 142 KB mobile savings.
Update both CLAUDE.md and README.md to document all performance
optimizations:

- CSS inlining rationale (eliminates 700ms blocking request)
- Font optimization (18 fonts → 3 critical weights)
- Responsive images (142 KB mobile savings)
- Explicit image dimensions (CLS: 0)
- LCP optimization (fetchpriority + preload)
- Updated Lighthouse score: 84/100 → 91/100
- Document new 'just generate-responsive-images' command

Ensures future maintainers understand the "why" behind each
optimization and can regenerate assets as needed.
@netlify
Copy link

netlify bot commented Dec 11, 2025

Deploy Preview for planetnix-com ready!

Name Link
🔨 Latest commit f8b4265
🔍 Latest deploy log https://app.netlify.com/projects/planetnix-com/deploys/693ad19a0efff900080bad91
😎 Deploy Preview https://deploy-preview-27--planetnix-com.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 project configuration.

Move the base branch Lighthouse report to /tmp before checking out
the PR branch, then restore it afterwards. This prevents the report
from being lost when switching branches, which was causing the
'Parse Lighthouse scores' step to fail.
@github-actions
Copy link

🔍 Lighthouse Performance Report

Performance audit completed for commit fd6a7db

Scores Comparison

Category Base (main) This PR Change
⚡ Performance 77/100 93/100 🟢 +16
♿ Accessibility 100/100 100/100 ⚪ 0
✅ Best Practices 100/100 100/100 ⚪ 0
🔍 SEO 100/100 100/100 ⚪ 0

Performance Impact

🎉 Great job! Performance improved by 16 points!

✨ Performance score is excellent!


📊 Score Guide
  • 🟢 90-100: Good
  • 🟠 50-89: Needs improvement
  • 🔴 0-49: Poor

Change indicators:

  • 🟢 Positive change (improvement)
  • 🔴 Negative change (regression)
  • ⚪ No change
🚀 Current Optimizations

Optimizations in place:

  • ✅ Image optimization (76.6% size reduction)
  • ✅ Lazy loading for below-fold images
  • ✅ Optimized fonts with font-display: swap
  • ✅ Minified CSS and assets

🤖 Automated report generated by Lighthouse CI comparing against main branch

@garbas garbas added this pull request to the merge queue Dec 11, 2025
Merged via the queue into main with commit e5cade6 Dec 11, 2025
5 of 8 checks passed
@garbas garbas deleted the more-optimization branch December 11, 2025 14:16
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