Remove Unused JavaScript and CSS

How to optimize staging.bangkokhospital.com

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

Remove Unused JavaScript and CSS

High Impact+25 points estimated

Why It Matters

492 KiB of unused JavaScript and 120 KiB of unused CSS are delaying LCP by 750ms combined.

How to Fix

Use Next.js dynamic imports to code-split components and defer reCAPTCHA loading until user interaction. Remove unused FontAwesome icons and implement tree-shaking for MUI components. Configure webpack-bundle-analyzer to identify and eliminate dead code in your Next.js build.

0Needs Improvement

What This Score Means

A score of 52 falls in the "Needs Improvement" 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

7.0s
Poor

Good: < 2.5s

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

INP

Interaction to Next Paint

302ms
Needs Improvement

Good: < 200ms

Measures how quickly the page responds to user interactions

CLS

Cumulative Layout Shift

0.03
Good

Good: < 0.1

Measures visual stability - how much content shifts during page load

AI Performance Analysis

This Next.js site has poor performance with a score of 52/100. The biggest problem is massive amounts of unused code - nearly 500KB of unnecessary JavaScript and 120KB of unused CSS are being downloaded, causing pages to take over 15 seconds to become fully interactive. The site is also loading legacy JavaScript polyfills and has font loading issues that block content rendering. Removing unused code, optimizing the build process to eliminate unnecessary polyfills, and implementing proper font display strategies could improve the score by 30+ points and dramatically reduce load times.

Other Optimization Recommendations

Optimize Font Loading Strategy

High Impact+18 points estimated

Why It Matters:

Font blocking is causing 530ms delay to First Contentful Paint with invisible text periods.

How to Fix:

Add font-display: swap to all custom fonts in your CSS. Implement font fallbacks with size-adjust properties to prevent layout shifts. Preload critical fonts in your Next.js _document.js using <link rel='preload'> for fonts above the fold.

Reduce Main Thread Blocking Time

Medium Impact+12 points estimated

Why It Matters:

806ms of Total Blocking Time prevents user interactions and degrades page responsiveness.

How to Fix:

Break up long JavaScript tasks by implementing React.lazy() for heavy components and using Next.js API routes to move processing server-side. Replace synchronous operations with async/await patterns and defer third-party scripts like FontAwesome using Next.js Script component with strategy='afterInteractive'.

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