Remove Unused JavaScript Code

How to optimize staging.aistudio.happythoughts.in

Next.js SiteScore: 92/100Analyzed May 2026Re-analyze this site

Remove Unused JavaScript Code

High Impact+3 points estimated

Why It Matters

152 KiB of unused JavaScript is delaying LCP by 450ms and wasting bandwidth.

How to Fix

Use Next.js dynamic imports to code-split Google Analytics and other third-party scripts. Move Google Tag Manager to load after page interaction using next/script with strategy='afterInteractive'. Remove unused polyfills by updating your Babel config to target modern browsers only.

0Good

What This Score Means

A score of 92 falls in the "Good" range (50-89). While it is better than poor (0-49), you should aim for 90+ to provide an optimal user experience and maximize SEO benefits.

This site is slower than approximately 35% of similar sites. The main issues affecting performance are image optimization, JavaScript execution time, and layout stability.

Addressing these issues could improve your conversion rate by 15-20% and boost your search engine rankings.

Core Web Vitals Analysis

LCP

Largest Contentful Paint

2.8s
Needs Improvement

Good: < 2.5s

Measures how long it takes for the main content to appear on screen

INP

Interaction to Next Paint

164ms
Good

Good: < 200ms

Measures how quickly the page responds to user interactions

CLS

Cumulative Layout Shift

0.00
Good

Good: < 0.1

Measures visual stability - how much content shifts during page load

AI Performance Analysis

This Next.js site has excellent performance with a score of 92/100, but there are still some optimization opportunities. The biggest issue is unused JavaScript code that's adding 152 KiB of unnecessary bloat, including from Google Analytics and React components that aren't being used on this page. The site's Largest Contentful Paint of 2.8 seconds could be improved by removing the lazy loading attribute from the main logo image and setting up proper caching (currently the logo expires after just 5 seconds instead of weeks or months). Additionally, render-blocking CSS files are delaying the initial page paint by nearly half a second, which could be resolved by inlining critical styles or deferring non-essential CSS.

Other Optimization Recommendations

Optimize Logo Image Loading

High Impact+2 points estimated

Why It Matters:

The LCP element (Logo.svg) has lazy loading applied which delays the critical paint.

How to Fix:

Remove loading='lazy' from the main logo image since it's above the fold. Add fetchpriority='high' to prioritize its loading. Consider inlining the SVG directly in the HTML or preloading it with <link rel='preload' as='image' href='/Logo.svg'>.

Implement Efficient Cache Headers

Medium Impact+1 point estimated

Why It Matters:

Logo.svg with only 5-second cache lifetime wastes 238 KiB on repeat visits.

How to Fix:

Configure Next.js static asset caching in next.config.js to set long-term cache headers for images. Add Cache-Control: public, max-age=31536000 for static assets. Use immutable file names with hashes to enable aggressive caching safely.

Keep Your Site Fast After Optimization

Once your site is optimized, maintain that speed. Use DeployHQ for zero-downtime, automated deployments—so performance fixes and updates go live safely every time, without breaking your site.

Explore DeployHQ →Trusted by engineering teams shipping high-performance sites

Want to Analyze YOUR Website?

Get AI-powered performance insights with actionable fixes in 30 seconds

More Next.js Speed Tests

Next.js Performance Resources

Frequently Asked Questions