Last updated on

In this Google PageSpeed Experiment, we’re testing W3 Total Cache’s Remove CSS/JS feature to understand its impact on website performance.

A screenshot showing the toggle for the remove unwanted css feature in W3 Total Cache

Our goal is to assess how this specific feature influences website speed.

Control Website

On our Control website we installed WordPress and the following plugins:

  • Contact Form 7
  • Molongui Authorship
  • My Calendar
  • Newsletter
  • Photo Gallery
  • Poll
  • Social Media and Share Icons (Ultimate Social Media)
  • TablePress
  • WordPress Related Posts Thumbnails

Control Website: https://wordpress-speed-test.com/03212024-a-before/

+27 Points

In this test, removing unused CSS and JS added over 27 points to the Google PageSpeed score! Read the documentation to learn how you can remove unused CSS and JS.

Upgrade to W3 Total Cache Pro and improve your PageSpeed Scores today!

Audit: Google PageSpeed Score
Before: 57.2
After: 86.7

Experimental Website

With our experimental website, we installed WordPress with the same plugins as our Control Website.

We also installed W3 Total Cache Pro and configured the Remove CSS/JS features.

Experimental Website: https://wordpress-speed-test.com/03212024-a-after/

Experimental Website Changes

WordPress plugins often load CSS and JavaScript files, even on pages where they’re unnecessary.

For instance, on our Control Website, the Contact Form 7 plugin adds CSS and JavaScript to the homepage, although no contact form is present.

This extra, unused CSS and JavaScript are called ‘bloat’ and can slow down your website unnecessarily.

To address this, on our Experimental Website, we removed many of these unnecessary CSS and JavaScript files from the homepage.

In the screenshot below, you’ll notice that we’ve removed some scripts and styles from our homepage. For instance, we don’t have a poll running on our homepage, so we don’t need the associated scripts. They’re unnecessary clutter, so we got rid of them.

A screenshot showing how we configured w3 total cache.

How the test was run

We conducted six tests on each website using the Google PageSpeed test and averaged all the scores.

-34% Potential
Savings from
Unused
JavaScript

In this test, removing unused CSS and JS changed the Potential Savings From Unused JavaScript from 127.5 KiB to 84 KiB. Read the documentation to learn how you can remove unused CSS and JS.

Upgrade to W3 Total Cache Pro and improve your PageSpeed Scores today!

Audit: Potential Savings From Unused JavaScript
Before: 127.5 KiB
After: 84 KiB

Test results

Desktop Mobile

Performance

Performance score

Standard site W3TC OptimizedDifference
57.17 84.67 +27.5 +48.1%

Points per Metrics

First Contentful Paint

Standard site W3TC OptimizedDifference
0.17 points 8 points +7.83 points +4700%

Largest Contentful Paint

Standard site W3TC OptimizedDifference
3.17 points 17 points +13.83 points +436.84%

Total Blocking Time

Standard site W3TC OptimizedDifference
30 points 30 points 0 points 0%
No change.

Cumulative Layout Shift

Standard site W3TC OptimizedDifference
22.5 points 22.5 points 0 points 0%
No change.

Speed Index

Standard site W3TC OptimizedDifference
1 points 7.67 points +6.67 points +666.67%

Metrics

First Contentful Paint

Standard site W3TC OptimizedDifference
3.72 s 1.12 s -2.6 s -69.96%

Largest Contentful Paint

Standard site W3TC OptimizedDifference
4.78 s 1.88 s -2.9 s -60.63%

Total Blocking Time

Standard site W3TC OptimizedDifference
1.67 ms 0 ms -1.67 ms -100%

Cumulative Layout Shift

Standard site W3TC OptimizedDifference
0.07 0.07 0 0%
No change.

Speed Index

Standard site W3TC OptimizedDifference
4.58 s 1.73 s -2.85 s -62.18%

Diagnostics

Largest Contentful Paint element

Standard site W3TC OptimizedDifference
4783.33 ms 1895 ms -2888.33 ms -60.38%

Potential savings from render-blocking resources

Standard site W3TC OptimizedDifference
4891.67 ms 630 ms -4261.67 ms -87.12%

Potential savings by serving images in next-gen format

Standard site W3TC Optimized
Passed audit Passed audit

Time third-party code blocked the main thread for

Standard site W3TC OptimizedDifference
0 ms 0 ms 0 ms
No change.

Potential savings from unused CSS

Standard site W3TC Optimized
59.17 KiB Passed audit

Potential savings from unused JavaScript

Standard site W3TC OptimizedDifference
127.5 KiB 84 KiB -43.5 KiB -34.12%

Potential savings if Minifying CSS

Standard site W3TC Optimized
3 KiB Passed audit

# of static assets without an effecient cache policy

Standard site W3TC OptimizedDifference
53 20 -33 -62.26%

JavaScript execution time

Standard site W3TC OptimizedDifference
0 s 0 s 0 s
No change.

Main-thread work

Standard site W3TC OptimizedDifference
0.43 0.28 -0.15 -34.62%

# of long main-thread tasks

Standard site W3TC Optimized
1 Passed audit

Initial server response time

Standard site W3TC OptimizedDifference
396.67 ms 393.33 ms -3.33 ms -0.84%

# of large layout shifts

Standard site W3TC OptimizedDifference
1.5 1.5 0 0%
No change.

# of user timings

Standard site W3TC Optimized
Passed audit Passed audit

# of animations found

Standard site W3TC Optimized
Passed audit Passed audit

Network payload

Standard site W3TC OptimizedDifference
1401.5 KiB 1167.5 KiB -234 KiB -16.7%

DOM size

Standard site W3TC OptimizedDifference
225 208 -17 -7.56%

# of chains found

Standard site W3TC OptimizedDifference
50 15 -35 -70%

Defer offscreen images

Standard site W3TC Optimized
Passed audit Passed audit

Minify JavaScript

Standard site W3TC Optimized
3 KiB Passed audit

Properly size images

Standard site W3TC OptimizedDifference
232.67 KiB 232.67 KiB 0 KiB 0%
No change.

Efficiently encode images

Standard site W3TC Optimized
Passed audit Passed audit

Enable text compression

Standard site W3TC Optimized
Passed audit Passed audit

Preconnect to required origins

Standard site W3TC Optimized
Passed audit Passed audit

Preload key requests

Standard site W3TC Optimized
Passed audit Passed audit

Preload Largest Contentful Paint image

Standard site W3TC Optimized
Passed audit Passed audit

Avoid multiple page redirects

Standard site W3TC Optimized
Passed audit Passed audit

Use video formats for animated content

Standard site W3TC Optimized
Passed audit Passed audit

Remove duplicate modules in JavaScript bundles

Standard site W3TC Optimized
Passed audit Passed audit

Avoid serving legacy JavaScript to modern browsers

Standard site W3TC OptimizedDifference
0 0 0
No change.

Largest Contentful Paint image was not lazily loaded

Standard site W3TC Optimized
Passed audit Passed audit

Avoids document.write()

Standard site W3TC Optimized
Passed audit Passed audit

Image elements have explicit width and height

Standard site W3TC OptimizedDifference
0 0 0
No change.

Has a <meta name="viewport"> tag with width or initial-scale

Standard site W3TC Optimized
Passed audit Passed audit

Uses passive listeners to improve scrolling performance

Standard site W3TC Optimized
Passed audit Passed audit

All text remains visible during webfont loads

Standard site W3TC Optimized
Passed audit Passed audit

W3 Total Cache

You haven't seen fast until you've tried PRO

   Full Site CDN + Additional Caching Options
   Advanced Caching Statistics, Purge Logs and More

Everything you need to scale your WordPress Website and improve your PageSpeed.

Leave a Reply

Your email address will not be published. Required fields are marked *

W3 Total Cache logo

We Can Help Optimize Your Website

Optimize your site’s performance with our one-time premium services or ongoing monthly VIP support. View services

Got a Minute?

Your feedback helps us improve. Complete our customer survey now.

Partners

Bunny CDN Logo