Improving Page Experience with LiteSpeed
As a site owner, you naturally want your visitors to have a seamless and successful visit that entices them to continue coming back. In May 2021, you were given an even better reason to improve page experience for your visitors: Page Experience became a factor in Google Search Rank.
While it seems like something too subjective to measure, there are actually some metrics that go a long way towards quantifying page experience. Across the web, page experience is considered good when the page loads quickly, is responsive to user input, and is visually stable. These aspects can be measured through a series of metrics known as the “Core Web Vitals.”
Today we will talk about these vital measurements, and give you tips to ensure your WordPress pages are delivering the optimal visitor experience.
NOTE: While we are talking specifically about WordPress here, know that these strategies apply to all kinds of sites. The tools needed to implement our suggestions, though, may vary for other CMSs.
Core Web Vitals
Google has defined a set of three Core Web Vitals. These measurements, when taken together, provide a way to quantify user experience and assign it a value.
The Core Web Vitals – Largest Contentful Paint, First Input Delay, and Cumulative Layout Shift – measure page experience by focusing on aspects of loading, interactivity, and visual stability, respectively.
Let’s look at each metric one by one.
Largest Contentful Paint (LCP)
LCP is a measure of loading performance. This is LiteSpeed’s specialty!
More specifically, LCP measures how long it takes to load the largest element on a page. It’s considered a user-centric metric, because it estimates the perceived load speed. Generally speaking, when the largest element on a page has rendered, the page will be ready to use, even if there are still smaller (and potentially less important) items yet to load.
There are primarily four things that impact LCP on your site:
- Server response time
- Resource load time
- Rendering on the client side
Chances are, each of these four elements can be improved for your site. Take a look:
Server response time
Action: Install LiteSpeed Cache for WordPress and enable caching.
Page caching is a crucial tool in your arsenal against sluggish server response times. When your site is cached, it requires much less involvement from the WordPress backend, which translates into a faster site and a better experience for your site’s visitors.
WordPress sites consist of dynamic pages that are built with PHP. The pages of a WP site don’t exist anywhere in the file system; they are constructed on-demand through PHP, and then served to the visitor as HTML. This can be a resource-heavy process, but page caching is an effective way of dealing with it. (You can learn more about this topic in our Caching 101 series.)
Some other suggestions for improving server responsiveness include:
- Optimizing your server
- Using a CDN (like QUIC.cloud!) with nodes nearer to your visitors than your origin site
Action: Enable Load JS Deferred and Load CSS Asynchronously in the LSCache plugin.
Other suggestions, (all available in LSCache Page Optimization):
- Inlining Critical CSS
- Activating Guest Optimization
Resource load time
Action: Sign up for QUIC.cloud CDN, and/or optimize your images.
A CDN such as QUIC.cloud is a smart idea, because it potentially minimizes the distance resources need to travel between server and client, which in turn makes the resources load faster.
While minimizing the distance resources must travel is important, you could increase the impact by also reducing the size of the resources themselves. This is where image optimization comes into play. LiteSpeed offers an image optimization service through QUIC.cloud, which compresses images, making them faster to transport and faster to load. The service allows you to optionally enable the modern, more efficient image format, WebP, as well.
- Preloading some resources
- Enabling file compression
- Caching static and dynamic content
Rendering on the client side
First Input Delay (FID)
FID measures your site’s responsiveness. How long does the site take to act when a button is pressed? For a good page experience, the interactive elements of your site should feel instantaneous and not sluggish. A low FID is important to user experience.
Cumulative Layout Shift (CLS)
CLS measures the visual stability of a page. How much do elements move around while the page is loading? CLS should be low to avoid the possibility of accidental clicks, or losing one’s place while reading, which can be frustrating for a user.
In general, CLS is impacted by these items:
- Lack of size attributes on images and videos
- Insertion of content above existing content
- Use of animation properties that trigger layout changes
Here are some strategies for improving CLS:
Lack of size attributes on images and videos
Action: Make sure all images, videos, and iframes have size attributes.
Generally speaking, text loads first on a page, and then the images and videos start filling in wherever they belong. If space for these resources is not reserved ahead of time, then the text moves around to accommodate the resources as they load. To avoid this, in your theme, and in your posts, all added images, videos, and iframes should explicitly list their sizes in the HTML code.
If you don’t want to do this manually, try LiteSpeed Cache’s Add Missing Sizes option in the Page Optimization > Media Settings section. If enabled, LSCache will detect any resources with missing size attributes, calculate the appropriate sizes, and add them to the dynamically generated HTML before caching the page.
Insertion of content above existing content
Action: Use static-size containers around variable-size items
This type of issue happens a lot when you have advertisements on your site, particularly ones where you let the ad service decide what size ad to stick in the spot. For example, you may have a banner ad at the top of your page, but it might at any time display a Leaderboard, Large Leaderboard, or Billboard sized ad. By not specifying a size ahead of time, any content that appears below the ad will be pushed down when the ad displays.
You can fix this problem by creating a container for that ad, which will display at the same time the text loads. When the ad renders, it will fit inside the box (and if it doesn’t fit, you can prevent it from exceeding the allotted space with an
overflow: hidden attribute).
Use of animation properties that trigger layout changes
ACTION: Switch to
Some CSS properties trigger a re-layout, which can cause page resources to move around undesirably. Instead of using CSS triggers – and there are a lot of them – try
transform, which does not trigger any geometry changes or painting on the page.
Other Page Experience Metrics
Your pages should be in good shape, if you master the Core Web Vitals, but there are other metrics that inform page experience, and you don’t want to ignore them:
Can your site be read and interacted comfortably with on a mobile device? These days, with so many internet users accessing content on the go, Google has adopted a “mobile first” philosophy. So, if your mobile site is functionally impaired, it will undoubtedly impact your page experience score and rank. You can evaluate your site’s mobile friendliness with Google’s Mobile-Friendly Test.
It probably goes without saying that your page should not contain malware, social engineering, or other malicious and deceptive content. You can check Google’s Security Issues report to be sure your site is clean.
Serving your site over a secure connection with HTTPS is more important than ever. Google penalizes insecure sites in terms of page rank, so if you want to rank, you need to be secure.
If you’re running LiteSpeed Web Server, which comes with secure HTTP/2 and HTTP/3 connections enabled out of the box, then you’re good. You can use the HTTP/3 Check tool to verify that your site supports HTTP/3 connections, or see our instructions to test for HTTP/2.
No Intrusive Interstitials
Interstitials include pop-up ads that cover the content, inline promotional material that appears above the fold, or any advertising that otherwise must be dismissed or scrolled past before the user can access the site’s actual content. Your site should be clear of such elements and your content easily accessible.
Of course, there is more to search rank than page experience. First and foremost, you need to provide content that answers the searcher’s question. But everything else being equal, a superior page experience can be the factor that puts your page ahead of that of your closest competitors.
As you have seen, our end-to-end WordPress solution provides excellent tools – LiteSpeed Web Server, LSCache Plugin, and QUIC.cloud CDN – to help you improve page experience.
If you are not a WordPress user, LiteSpeed Web Server with LSCache can still be of value to you. We have cache plugins for many other CMSs, or you can use LSCache without a plugin.
With LiteSpeed, you can address problems with Core Web Vitals, and improve page experience for your users while simultaneously working your way to the top of the Google Search Results!
This content was last verified and updated in April of 2023. If you find an inaccuracy, please let us know! In the meantime, see our documentation site for the most up-to-date information.