Google highly ranks websites with quick loading times and perfect web vitals. You can enhance your website’s speed significantly by using robust caching to reduce the Time To First Byte (TTFB) speed parameter.
Our URLsLab plugin’s caching module provides complete control over your website’s caching headers and speed. Its capabilities go beyond simply caching the entire html page to your local filesystem and servicing all requests from the cache. Even some features in URLsLab plugin require you to pay for credits, all caching features are free forever!
With the URLsLab plugin, you can manage caching on several levels with complex caching rules:
Many cache control plugins require you to modify .htaccess file to define correct cache control headers. URLsLab plugin handle all with easy to manage rules editable on the fly directly in your plugin. No need to edit .htaccess file or give plugin a permission to modify it.
The basic settings in the URLsLab WordPress plugin lets you set a global cache validity for all requests. But content on your website changes at different rates in different parts of the website and may need different cache validity settings.
With our flexible cache rules, you can define specific cache validity for each file type or website section. For example, if you have a page that only updates a few times a year, like a blog post page, you can set a longer cache validity period, such as a month. On the other hand, a page continuously updated like a list of blog posts, should have a shorter cache validity.
To make your WordPress page run swiftly, manage caching at numerous levels: in the browser, on the CDN, and on the web server. The purpose of caching is to swiftly provide content to a user’s browser and cut down on the server interactions over the network. Ideally, all files needed for your page should already be saved on the user’s computer.
Browser caching works by storing website data locally on the user’s computer. When the user visits a web page, certain elements like images, HTML, CSS and JavaScript files are saved. The next time the user visits, the browser can load these saved elements from local storage, making the website load faster as it doesn’t have to retrieve all data from the web server again.
You can control how long browser stores these file by cache control header defined on your web server. Each file type can be stored different amount of time locally and some pages you don’t want to cache at all (e.g. pages for logged in user, which are most of the time unique).
You can easily inspect caching of your own WordPress website in browsers (right click in page and select menu Inspect):
Here, most requests are managed by your browser from the local cache, without needing your CDN or webserver. This means the load time will be zero.
CDN’s primary role is to both store data of a website (like images, CSS, JavaScript files) and deliver it swiftly to users. This process happens when CDN saves a website’s content in various data centers located worldwide. When a user visits your website, CDN delivers the content from the data center closest to the user. This entire mechanism improves your website’s speed and performance.
Using a CDN has several advantages. Most significantly, it enhances your website’s load speed (Time To First Byte), which is vital for retaining visitors and improving your SEO ranking. It also escalates your site’s scalability to handle increased traffic, ensuring a consistent user experience.
Cache control headers play a crucial role in controlling cache validity. Web servers can use these headers to specify caching policies like when and how long a CDNs or browser should cache the website content. This cache can be refreshed or invalidated, ensuring site visitors always see the most recent version of your webpage.
URLsLab WordPress plugin enhances your website’s performance by effectively using CDN and managing cache control.
Plugin enhance your website’s efficiency through a simple local HTML page caching mechanism. It starts off when WordPress generates a page. The plugin then saves this page’s html content to local file. If another user later navigates to this same URL, plugin swiftly provides them with the pre-saved HTML page. This eliminates the need for on-the-fly server page generation and drastically reduces requests to the database. This boosts the web server’s response time, enabling it to tackle an even greater number of requests per second.
Store generated HTML page to local file system and next time other visitor opens the same URL, deliver the page from the file system. If your server infrastructure consist of multiple web servers, local copy needs to be generated on all of them. Cache files are not synchronized between your web servers.
After activating the caching module, make sure to tick the ‘Page Cache’ checkbox to enable local HTML cache. The cache files will be stored in your WordPress ‘uploads’ folder.
Default Cache Validity (TTL)
In the absence of any custom cache rules for a currently opened URL, the default cache validity, also known as Time To Live (TTL), is applied to the page. This rule applies to all website pages older than 24 hours. If any custom rules are applied, they override the default value due to their higher priority.
Cache Validity for Newly Added/Updated Content
Input value should be integer number – represents cache validity time in seconds.
This setting is beneficial when your copywriter is frequently updating content on a page. If the page is still under development, it’s best to set the cache validity shorter (e.g. few minutes or one hour). The plugin will auto-adjust to this shorter validity. Even if the global settings are for weeks or months, users will receive the most recent content. Once the editor stops updating the post, after 24h will be automatically cached your post with longer default validity time.
Clear cache
Button allows you to invalidate or clear local cache stored on your web server. In case of Multi-Server installation, cache is just invalidated to given timestamp, files will not be physically deleted from all your web servers. In case of single-server environment will be cache invalidated and plugin will try to delete all local files in cache folder. Cache folder is located in uploads directory.
Link preloading is an advanced performance enhancement technique that smartly anticipates user navigation by preloading content linked with likely URLs, enabling instant page rendering upon selection. This method improves user experience by minimizing delay and speeding up smooth page shifts.
Link Preloading – On Hover
Page will be loaded to browser as visitor moves cursor over the link before he clicks the link. Once the visitor clicks the link, he will see immediate response and new page will be loaded within milliseconds.
Link Preloading – During Page Scroll
All links visible in the browser window will be preloaded as user scroll through the page. This option can generate significant traffic in the background, but as more and more pages will be cached in local browser cache, responses to navigation between pages will be nearly immediate for your visitor.
Prefetching in browser initiates automatic downloading and caching of content in line with potential user inquiries. It promotes prompt loading of content when required, cuts down on waiting times, and enhances user experience without the need for a specific user request.
DNS prefetching resolves domain names in advance, speeding up load times by reducing the time associated with domain lookup at request time. Plugin will add to your html header dns-prefetch link tags for each domain you specify:
<link rel="dns-prefetch" href="https://example.com/" />
Content Prefetching
Resources should be prefetched based on how likely it is that they will be needed in a future navigation. Browsers can infer this automatically for some resources, such as the current URL in the address bar. Plugin will add for each specified URL in this setting HTML tag to page headers:
<link rel="prefetch" href="content.html" />
URLsLab plugin integrates with CloudFront CDN. In the future we plan to add support for next CDN networks. This feature helps you to manage cache objects in your cloudfront (e.g. drop part of the cache).
Cloudfront cache can be invalidated in Cache Settings section or manually in admin menu toolbar:
To add custom rules for cache control headers go to menu URLsLab -> Cache -> Tab “Page Cache Rules”. Here you can define custom settings for cache validity without modification of .htaccess or ModRewrite rules. Simply define the rule in plugin and it will be automatically applied based on your conditions. Rules are cached in the local file system of each application server, performance of your web server should not be degraded. Rules are evaluated in the order specified by priority field. Once first rule will match incoming request, rule settings are applied and next rules are not evaluated anymore.
Each time any request is sent to your WordPress installation, all the rules are evaluated and HTTP Cache-Control header is set in response to CDN or browser.
Match type
Cache validity – how long (in seconds) will be stored the content of request in browser or CDN.
Request headers – comma separated list of headers or header and values – if request contains given request header or specific value, condition is met. HEADER_NAME, HEADER_NAME=value. Leave empty to match all.
Cookies – Apply rule only for requests with specified cookie sent from the browser. List the cookies to be checked, separated by commas. For instance: COOKIE_NAME, COOKIE_NAME=value. Leave empty to match all.
Request Parameters – Apply rule only for requests with specified GET or POST parameter. List the parameters to be checked, separated by commas. For instance: query-param, query-param=value. Leave empty to match all.
Visitor IP – Apply rule just for visitors from certain IP addresses or subnets. Provide a comma-separated list of IP addresses or subnets. For instance: 172.120.0.*, 192.168.0.0/24
Browser – Apply for visitors using specific browsers. Input browser names or any string from User-Agent request header, separated by commas
Imagine you want to set custom cache validity to 86400 seconds (1 day) for your blog posts, but not for the page with list of blogs. e.g. page https://www.liveagent.com/blog/ should have default cache settings, but any blog post should have cache validity 1 day (e.g. https://www.liveagent.com/blog/10-reasons-why-live-chat-is-important-for-your-business-website/)
Rule would look like this:
There are numerous WordPress plugins that use different caching mechanisms. In this section, we will compare some of these plugins. Our goal is to assist you in determining the best caching plugin for you, considering URLsLab as your primary option.
The URLsLab plugin offers some premium features as AI Content Generator or SERP Monitoring, Cache Module, is free without any limitations. This includes advanced features such as cache control, preloading, lazy loading, browser caching, , html, css, js minification, and more. Plugin is backed by development team of well known multichannel help desk and live chat software called LiveAgent.
WP Rocket is a premium caching plugin. It offers a wide range of features such as page caching, cache preloading, and browser caching. It is known for its user-friendly interface and excellent performance. WP Rocket is a premium plugin with pricing starting at $59 per year.
W3 Total Cache is a feature-rich caching plugin that supports various caching methods, including page caching, database caching, and object caching. It also offers CDN integration and minification of CSS and JavaScript files. W3 Total Cache is a free plugin.
WP Super Cache is a simple and lightweight caching plugin that generates static HTML files and serves them to visitors, reducing the load on the server. It offers options for caching logged-in users and mobile devices. WP Super Cache is a free plugin.
Hummingbird offers detailed controls over file compression, the deferring of CSS and JavaScript styles and scripts, minifying capabilities for CSS and JS, Lazy Load integration, along with top-tier caching.
Hummingbird is created by the same developers behind the renowned Smush image optimization WordPress plugin.
The LiteSpeed Cache for WordPress (LSCWP) is a comprehensive tool for speeding up your website. It provides an unique server-level cache and several features to optimize your site’s performance. LSCWP plugin fully supports WordPress Multisite, working with many widely-used plugins. Some of these include WooCommerce, bbPress, and Yoast SEO. LiteSpeed Cache for WordPress also works well with ClassicPress.
These are just a few examples of the caching plugins available for WordPress. Each plugin has its own set of features and pricing options, so it’s important to carefully consider your website’s needs and performance goals before choosing a caching plugin.
Remember to test different plugins and monitor their impact on your website’s performance. Additionally, consider alternative solutions like managed WordPress hosting, which often includes built-in caching at the server level.
A common error among WordPress users is having multiple cache plugins installed and activated at the same time. This can often slow down your website’s speed and introduce difficult-to-solve bugs. To avoid issues, select the plugin that suits your needs and deactivate all other cache plugins.
By optimizing your website’s caching, you can significantly improve loading times, search engine rankings, and user experience.