WP Core Web Vitals :: Caching
Take back control of your website's speed with WP Core Web Vitals
Core Web Vitals Caching overview:
If you're running a website on WordPress, you already know that speed and performance are crucial for user experience and search engine rankings. Slow websites not only frustrate visitors, but they can also hurt your business by causing a high bounce rate and low conversions.
Table of Contents!
One of the most effective ways to boost your website's speed and performance is by using WP Core Web Vitals caching plugin for WordPress. In this article, we'll explore what WP Core Web Vitals caching is, how it works, and why it's important.
What is caching?
Caching is the process of storing frequently accessed data in a temporary storage area so that it can be quickly retrieved when needed. In the context of website performance, caching refers to storing website data, such as images, HTML pages, and JavaScript files, on the user's device or on a server close to the user's location.
By caching website data, the website can load faster and provide a better user experience. When a user visits a website for the first time, the website's data is loaded from the server to the user's device. However, when the user revisits the website, the cached data is loaded from the local storage, which is much faster than loading the data from the server.
Caching is important for WordPress websites for several reasons:
Did you know ...
"WP Core Web Vitals outperforms other pagespeed plugins by 160% on average!"
WP Core Web Vitals - Page Caching Options
Page Caching has several options to optimize WordPress cache settings:
- Cache page files
- Cache Time To Live
- Bypass cache
- Clear pages on new post
- Cache pages with url parameters
- Minify HTML
WP Core Web Vitals - Page Caching Settings
Cache page files
Cache page files enables or disables the WP Core Web Vitals caching mechanism. This setting should always be enabled unless you are actively working on the site or the site is in staging mode.
Enabling the caching system will improve the Time To First Byte. The time to first byte is a dependent metrics for all the pain metrics (Fitst Contentful Paint and Largest Contentful Paint). A high time to first byte will make the page stay 'blanc' or a longer time. A short time to first byte is the first step in 'pages that load immediately'.
Our caching system is pretty smart, it will clear the cache of certain pages when you have made changes to the site and it will serve the optimal cached file to the right users.
Recommended setting: yes
Cache Time To Live
Cache Time To Live determines how long the cache file can be used by the webserver. The longer you let the cache live the more effective it will be because this increases the likelihood of the cache file being 'hit'. If your page changes regularly (and even though there are cache invalidation mechanisms that would prevent this ) it might be more reasonable to set the cache time to live to a somewhat shorter period.
Recommended setting: 1 month
Bypass cache
Bypass cache bypasses the cache mechanism for pages that match a certain pattern. This can be useful for dynamically generated pages that need to be 'fresh' 100% of the time.
WP Core Web Vitals will also honor a variety of cache hints like the 'DONOTCACHEPAGE' wordpress constant. If a page is not elagable for caching we will not cache that page and server a fresh version of the page .
When a page is not eligible for caching some 'slower' optimizations that need to read files like 'combine styles' or 'add missing image width and height' will be disabled for your benifit!
How does it work? Simply add a part of the page url in to input and any url that matches that pattern will be bypassed. For example feed matches www.example.com/feed and also example.com/how-to-feed-your-pet while /feed only matches www.example.com/feed.
Recommended setting: leave empty unless needed
Clear pages on new post
Clear pages on new post clears and reloads the page level cache for the urls added to this option. WP Core Web Vitals by default clears the cache for the page/blog itself, the blog listing and the user listing page. ID there are more pages caches that need to be refreshed (for example the homepage), add them here!
Recommended setting: leave empty unless needed
Cache pages with url parameters
Cache pages with url parameters will cache all pages, even if they have url parameters like /index.php?filter=1
Caching pages will speed up your site immensely. So usually you want to cache as many pages as you can. But in WordPress URL parameters usually come from product filters. With almost limitless combinations of filter options your cache file could become extremely large. That is why usually you want to disable this setting.
Recommended setting: no, unless you are not rewriting your urls
Minify HTML
Minify HTML will minify your HTML code. Minified HTML code is HTML with all the unneeded characters like tabs, newlines, comments etc stripped away.
Minified HTML can be up to 10% smaller so it is transferred faster over the network. This will improve your Time To First Byte and with it the paint metrics.
But be careful: Minify HTML might break your page if it contains a huge amount of HTML errors. If that is the case do not just disable this function but try and fix the errors!
Recommended setting: yes
Frequently asked questions
Do I need a caching plugin?
Yes you probably do. Not only does a caching plugin make your website much faster. It also saves a lot of CPU calculations and that is pretty good for the enviroment!
Do I need to disable other caching plugins?
Yes, you do. WP Core Web Vitals caching is designed to work together with all the other optimization options. Other caching plugins might prevent us from generating Critical CSS for example.
Can caching plugins cause issues with my WordPress website?
A cache plugin will send the HTML version of a page that was created at a certain time. If the site has changed (a lot) by then you will need to clear the cache. That should solve all the issues
Is WP Core We Vitals caching compatible with WooCommerce?
Yes, WP Core Web Vitals is fully compatible with WooCommerce. When an item has been placed in the basket we will disable our caching mechanism for that visitor and only send fresh and uncached versions of the page!
How do I clear the Cache?
When you are logged in as an administrator the 'WP Core Web Vitals' toolbar will appear on the top of the page. Click on 'WP Core Web Vitals' and then click 'Clear Cache'. In a few moments the Clear Cache text will turn green. This means the cache has been fully cleared.
Can I automatically preload the Cache
Yes, you do not have to do anything. The Cache will be preloaded automatically. The preloading mechanism relies om RUM data, that way we can prioritize the most important pages that get the most pageviews!
How can I test if my caching plugin is working properly?
The easiest way to check if the cache is working is to visit the page and view the source.Just visit you site incognito, right click somewhere on the page and click 'view page source'. The last line of the page should read '<!-- cached and optimized by www.corewebvitals.io -->'.
Can WP Core Web Vitals cache pages for logged-in users
We could, but we decided not to because that makes little sense. When you are a 'logged-in-user' you will always need personalized content. That is why caching is always bypassed for logged-in users.
How can I test if my caching plugin is working properly?
Thea easiest way to check if the cache is working is to visit the page and view the source.Just visit you site incognito, right click somewhere on the page and click 'view page source'. The last line of the page should read '<!-- cached and optimized by www.corewebvitals.io -->'.
Will pages in the WP admin dashboard be cached?
No, those pages need to be 'fresh'. We do not cache backend pages!