Reduce Unused JavaScript Bundle Size

How to optimize staging.deployhq.com

Ruby on Rails SiteScore: 70/100Analyzed February 2026

Reduce Unused JavaScript Bundle Size

High Impact+18 points estimated

Why It Matters

Unused JavaScript consumes 145KB and delays LCP by 750ms with blocking scripts from Google Analytics and consent management.

How to Fix

Configure Rails asset pipeline to code-split JavaScript using dynamic imports. Move Google Tag Manager and Usercentrics to load asynchronously after page interactive. Use Rails' javascript_include_tag with defer: true for non-critical scripts.

0Needs Improvement

What This Score Means

A score of 70 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

10.3s
Poor

Good: < 2.5s

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

INP

Interaction to Next Paint

135ms
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 Ruby on Rails site has poor performance with a score of 70/100, struggling with extremely slow loading times. The biggest problem is an excessive 10.3-second Largest Contentful Paint, caused by a combination of unused JavaScript (145 KiB from Google Analytics and tracking scripts), unused CSS (85 KiB), and inefficient image delivery. The site is also doing 2.8 seconds of unnecessary main-thread work, primarily from unoptimized JavaScript parsing and execution. Removing unused code, minifying assets, optimizing images, and adding priority hints to key images could dramatically improve performance and user experience.

Other Optimization Recommendations

Optimize LCP Hero Image Priority

High Impact+12 points estimated

Why It Matters:

The hero background image lacks fetchpriority=high directive, preventing optimal loading performance for the largest contentful paint element.

How to Fix:

Add fetchpriority='high' attribute to the hero image in your Rails view template. Ensure the image is not lazy-loaded and include appropriate width/height attributes. Consider using Rails' image_tag helper with loading: 'eager' and fetchpriority: 'high' options.

Eliminate Unused CSS and Minify

Medium Impact+8 points estimated

Why It Matters:

91% of CSS rules are unused (85KB waste) and files lack minification, adding 300ms to LCP and 250ms to FCP.

How to Fix:

Enable CSS minification in Rails production environment by setting config.assets.css_compressor = :sass. Use PurgeCSS gem to remove unused styles automatically. Split CSS into critical above-the-fold styles and defer non-critical CSS loading.

Want to Analyze YOUR Website?

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

More Ruby on Rails Speed Tests

Ruby on Rails Performance Resources

Frequently Asked Questions

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