WordPress.NewCitizen.io

Speed Optimization Guide

Your Attention Please !

After selecting your desired 'Optimization' section from the table, please scroll again to the very bottom of the page to view the material.

A complete and Comprehensive Guide On Making WordPress websites faster.

Don’t be overwhelmed by the table below; most optimizations can be easily achieved with an optimization plugin. I personally use the free Speed Optimization plugin that comes bundled with SiteGround’s Hosting plan. However, there are several other options, including W3 Total Cache (W3TC), WP Rocket, and FlyingPress.

Steps to optimizing your WordPress website :

1. Visit GTmetrix: Enter your website’s URL to begin the test. GTmetrix offers this tool for free and allows multiple tests to be performed every hour, at no charge.

2. Review the Report: GTmetrix will quickly generate a performance report, pinpointing each area that requires improvement.

3. Consult our table below to address the specific areas highlighted by GTmetrix. While GTmetrix often uses complex terminology, overcomplicates its instructions, and provides guidance for a broad spectrum of websites, we’ve streamlined and tailored their recommendations specifically for WordPress sites. With our clear and straightforward guidelines, you’ll find it much easier to understand and implement the necessary changes.

4. Re-test After Implementing Changes: After making a change, clear your website’s cache if it’s enabled. Re-test on GTmetrix to assess the impact of your adjustments. Using the new results, move on to the next suggested improvement and continue the process.

Implementing this feature can be achieved by using an Optimization Plugin:

 

 

Minimize Main-Thread Work

The efficiency of ‘minimizing main-thread work’ holds significant weight concerning your site’s performance. The main-thread shoulders most tasks linked with page loading, and your site’s speed is directly proportional to the main-thread’s workload. It’s vital to ensure this main-thread isn’t overburdened to guarantee swift page rendering and maintain responsiveness.

What is the Main-Thread?

The main-thread is the engine driving most browser tasks associated with your page’s load, from rendering content to managing user interactions. Key responsibilities of the main-thread encompass:

  • Layout management
  • Parsing of CSS and HTML
  • Constructing the Document Object Model (DOM)
  • Executing JavaScript (by default)

Think of the main-thread as a cafe’s server, taking orders, managing payments, serving dishes, refilling drinks, etc. If bogged down with a singular task, like handling a complicated order, they’re hindered from executing other duties. This inefficiency potentially impacts your perception of the cafe’s service quality.

How Main-Thread Minimization Influences Page Performance

Lightening the load on the main-thread empowers the browser to prioritize other critical tasks during page load. Tasks such as HTML/CSS parsing and JavaScript execution can monopolize the main-thread, restricting its ability to manage other tasks or respond to user actions. JavaScript execution often stands out as a significant contributor to main-thread congestion, especially if your website is heavily dependent on it. A high reliance on JavaScript, manifested through extensive, sizable, or multiple scripts, typically elongates parse and compile times. Consequently, users might experience delays in content display and interactions on your page.

Explore more about decreasing JavaScript execution duration here.

Minimizing Main Thread Work in WordPress to optimize website speed

When JavaScript executes for an extended period (like A,B,E previously mentioned), it can monopolize the main-thread. This can hamper the browser’s ability to handle other vital tasks essential for the initial page rendering. Likening it to our restaurant analogy, reducing the tasks a waiter must carry out can accelerate service and elevate the overall dining ambiance.

How to Optimize Main-Thread Work in WordPress?

Elevating main-thread efficiency should be a top priority in your development strategy. You can predominantly enhance main-thread performance by:

  • Reducing down script evaluation time.
  • Minimizing style recalculations and layout adjustments.
  • Shortening CSS/HTML/JavaScript parsing durations.
  • Eliminating any delay in rendering page content. The following techniques aid in realizing these improvements:
1. Optimizing Third-party JavaScript
  • Assess third-party scripts on your site and eliminate any non-contributory ones.
  • Optimize the performance of the necessary scripts by delaying non-vital scripts, establishing swift connections to essential third-party domains, lazy-loading third-party content, and bolstering third-party hosting efficiency.
  • Dive deeper into optimizing third-party JavaScript here.
2. Leveraging Web Workers
  • Utilize web workers to offload JavaScript from the main-thread and enhance page responsiveness. More insights on web workers can be found here.
  • Further details on slashing JavaScript execution time can be accessed here.
3. Trimming CSS Parsing Duration
  • Reduce CSS parsing timeframes by minifying it, deferring non-essential CSS, or discarding unused CSS segments.
4. Prioritizing Compositor Properties
  • Stick to compositor properties since they allow events to operate on an isolated compositor thread, bypassing the main-thread. This lightens the main-thread’s workload, boosting loading speeds.
  • Deep dive into this strategy here.
5. Utilizing CMS Plugins
  • For those using WordPress or other CMS platforms, this optimization can be implemented using plugins
  • For example, The Siteground Optimization Plugin can minify CSS/JavaScript, defer non-critical CSS/JavaScript, remove unused CSS, lazy load third-party resources with facades, etc.