Cache lifespan can be set to run at a specific time but there is a catch here which we will describe and help you find a way to make sure it runs without any issue.
Cache lifespan of SpeedyCache is dependent on WP Cron, which is a Cron functionality of WordPress. But this is not an actual Cron. A cron is a utility which is used to schedule jobs which is independent of any user visiting the website and will work until the server is running.
Whereas WP Cron is dependent on users visiting the website, which means if no user comes to your website, the WP Cron will not work, hence none of the functionality dependent on the WP Cron will work.
Lets take an example of running cache lifespan at 2:00 AM, so if no user visits the site at 2:00 AM then the WP-Cron will not work hence no cache will be deleted.
To make sure that cache lifespan works, you will need to use the real CronJob. For that you will need to have access to your Control Panel.
Given that you have access to the Cron Job from your control panel, you will need to use the below command as the command for Cron Job and make it run every 5 minutes or as per your need.
wget -q -O - https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1Once you have saved the cron settings now you need to do one more thing, which is to add a line in wp-config.php
define('DISABLE_WP_CRON', true);You need to add this constant in the wp-config.php, what it does is it will not initiate WP-Cron when the user visits and will only work based on the CronJob you have set, which will make sure this works every time whether users are coming to your website or not.
If you face any issue doing it, reach out to our support at [email protected]
Removing unused CSS is a really useful feature, it helps in reducing the CSS being loaded on the WordPress websites, as there are many page builders which loads CSS which is not required to load the page.
NOTE: Using Unused CSS and Critical CSS together is not recommended, as it will not provide significant performance benefits. Critical CSS is more beneficial if you are using a good page builder that keeps CSS lean by default. Unused CSS is more beneficial if your editor is loading unnecessary CSS.
It is best to try both to see which one improves your performance, as this note is a suggestion and not an absolute rule.
SpeedyCache extracts required CSS to render the pages and gives 3 options to handle the unused CSS, which are:-
Removing is the most aggressive option, and results in faster speed of the page compared to the other 2 options.
Other than that Unused CSS feature has 2 more options Exclude Stylesheets and Include selectors.
You can exclude certain CSS files which you do not want to remove from your Page, you can either add the full URL of the CSS file you want to exclude or you can just enter the name of the file.
In this options you can add the selectors you want to be added to the resultant Used CSS, which will be generated after removing the Unused CSS.
Unused CSS is a really useful feature to help improve the performance of the page as it remove unwanted CSS reducing the total size of the content browser need to download.
Lazy Rendering of HTML elements can help in reducing the Rendering time of your HTML page, and improving the Largest Contentful paint.
Lazy rendering is a technique that defers loading of non-critical HTML elements until they are needed. This can help to improve page speed and user experience, especially on complex websites and websites with large pages.
When a web page is loaded, the browser first renders the critical rendering path (CRP). The CRP is the set of elements that are essential for the page to be displayed and interacted with. Once the CRP is rendered, the browser can start loading the rest of the page's resources.
Lazy rendering allows the browser to skip rendering of non-critical elements until they are needed. This can save a significant amount of rendering time, which can help to improve the Largest Contentful Paint (LCP) metric. LCP measures the time it takes for the largest contentful element (LCE) on a page to become visible.
Note: This feature will work with, Chromium browsers like Google Chrome, Microsoft Edge, Brave. It will work with Opera Browser too. In Firefox this feature is not enabled by default, for more information check Browser Compatibility.
There is a difference between Lazy Load and Lazy Render. The object that is subjected to get Lazy Render gets loaded same time as other content, its just the Rendering of the element is skipped till that element comes into view-port.
Whereas in case of Lazy Load the object gets loaded later, which means that element get loaded and rendered after it has reached the view-port.
To use Lazy Rendering HTML element in SpeedyCache follow the steps below :-
1. In your WordPress admi go to SpeedyCache from the left Navigation.
2. Once you are on SpeedyCache Settings page, now in the settings tab in the File Optimization section enable Lazy Render HTML element.
3. One you enable it you will get a pop-up or you can click on the settings link to open the pop-up.
4. Now you have to get classes or id you want to Lazy Render.
5. Once you add the classes and ID's then submit it and then save setting. And now your elements will be rendered lazy. They will only be rendered once they get into view-port.
If you want to do it on your own you can just add this small CSS to Lazy Render your elements.
#element_id{content-visibility:auto;contain-intrinsic-size:1px 1000px;}You can add this CSS through your Customizer in WordPress or directly add to theme CSS file. Make sure to replace the #element_id with the ID of the element you want to replace.
In case you want to Lazy Render multiple elements, you can do something like the following.
#element_id, .element_class, aside{content-visibility:auto;contain-intrinsic-size:1px 1000px;}If you face any issue you can contact out support team and we will help you out. Write us at [email protected]
WooCommerce loads some assets, such as scripts and styles, on every page, even if those assets are not needed on that page. This can be a waste of server resources and can slow down the website, as the browser has to download and process these assets even if they are not used. For example, WooCommerce assets will load on the about page, even though there is no WooCommerce functionality on that page.
Disabling WooCommerce assets ensures that only the scripts and styles that are actually needed on a page are loaded. This can save a significant amount of server resources and improve page speed, especially for pages that do not have any WooCommerce functionality.
If you face any issue do let us know at [email protected]
jQuery Migrate is a JavaScript library that helps to preserve the compatibility of your jQuery code with older versions of jQuery. It does this by restoring deprecated APIs and features that have been removed from newer versions of jQuery. If you are using updated plugins, you may not need jQuery Migrate, as these plugins will often be updated to work with the latest versions of jQuery. However, if you are using older plugins, or if you have custom jQuery code that relies on deprecated APIs, then you will need to use jQuery Migrate in order to ensure that your code continues to work.
Removing jQuery Migrate will reduce the number of requests your website makes to the server by one. This is because jQuery Migrate is a separate JavaScript file that is loaded in addition to the main jQuery file. The size of jQuery Migrate is typically around 14KB, so removing it make your website load a little bit faster.
We are assuming here that you have already installed SpeedyCache on your WordPress site
If you face any issue feel free to contact our support at [email protected]
In this guide we will help you configure SpeedyCache to Delay JS in your WordPress site.
When a user visits your WordPress website, their browser starts rendering the page's HTML content. As the browser encounters JavaScript files, it pauses the rendering process to fetch and parse each script. This can significantly slow down the overall page load time, especially if you have multiple JavaScript files or heavy third-party scripts like Google Adsense or Google Analytics.
By deferring the parsing of JavaScript, you can instruct the browser to delay the downloading and execution of these scripts until after the HTML content has finished loading. This allows the user to see and interact with the page's main content faster, improving the overall user experience. Additionally, deferring JavaScript can positively impact various performance metrics, such as Largest Contentful Paint (LCP) and Total Blocking Time (TBT), which are crucial for SEO and website rankings.
To delay JS in your WordPress site follow these steps:-
Note: Do not combine scripts when using Delay All JS because it will break the normal functioning of your website.
Using Delay JS will also affect the analytics if you choose to delay the Analytics Script as it wont count bots or users who don't interact with your website. But it wont affect crawlers from crawling your website.
The events on which the scripts get loaded are listed below:-
If no event gets triggered the delayed scripts will load after 10seconds.
If you face any issue you can contact our support team [email protected]
In this guide we will list all the Object Cache configuration present in SpeedyCache to help you enable Persistent Object Cache in your WordPress site.
Note: This does not work with Redis Cloud service provided by Redis. For this to work, you should have Redis enabled on your server.
Note: PHP Redis is just a connector between Redis and SpeedyCache and is not the actual Redis server.
We have made sure the configuration is easy to use and configure.
1. Host: It will be the IP your Redis server will interact from by default it's 127.0.0.1, but if you are using your Redis server through a Unix socket then the host will have the path to the socket, it won't be the full path but the relative path to the root, for example /var/run/redis/redis-server.sock
2. Port: It is the port number where the Redis server listens to the requests. By default it is 6379 but if you are using Unix socket then you don't need to set socket anything because if SpeedyCache find the request host is a socket then it doesn't looks for a port. But if you are configuring redis.conf file then there you will need to set port as 0.
3. Username: Option to use username was made available in Redis in version 6.0 through ACL, before that only password was available to access control. So if you are using Redis version 6.0 and above only then username is applicable for you.
4. Password: It's the password you set in Redis either using the requirepass method or through the ACL method.
5. Object Time to Live: It's the time(in seconds) for how long you want a single object to live as a cache. Once the expiry time is reached then that object will be deleted.
6. Redis DB ID: It's the ID of the database, unlike other databases Redis just has database ID. That too is limited to 16(it can be increase through the Redis config file). So you should always use different ID for different website else you will see weird results, like your website getting redirected to different website.
7. Persistent Connection: This options makes the connection from Object Cache to remain open as it helps reduce the time taken to connect on every request, by default it is turned on in SpeedyCache Object Cache.
8. Cache WP-Admin: This will cache the pages of Admin Dashboard too if enabled. It will reduce the database queries when the Admin is using the Dashboard.
9. Asynchronous Flushing: If enabled, it will delete the cache in non-blocking way, So the key where the data is saves is unlinked immediately but deletion takes place asynchronously.
10. Serialization Method: It's used to convert the data into a serialized format, by default its set to PHP serialization but you can choose to serialize through igbinary, but for the your phpRedis need to be compiled with igbinary.
It's suggested that you change this option, you should first disable Object Cache and then flushdb. Because directly updating this option will result in Crashing your website.
11. Compression Method: It's used to compress the data being saved. It saves lot of memory. But all the options require that the Compression options be complied with phpRedis. The available compression options are LZF, LZ4, and ZSTD.
For updating this option too you should first disable Object Cache first and then flush the DB before saving the new options to prevent the Crashing of your Website.
12. Do not Cache Group: These are the groups you don't want to get cache in the Persistent Redis cache. You need to write one per line.
If you face any issues setting up these configurations contact our support team and we will help you Setup Object Cache.
Critical CSS is the minimum CSS required to render above-the-fold content i.e; The CSS required to render the part of a page in a visible view-port at the time of render.
So what Critical CSS feature in SpeedyCache do is, it extracts the Critical CSS of the page, and then in-lines the generated CSS in the HTML of that page and makes other externally included CSS asynchronous.
There are 3 ways Critical CSS can be created
This method is Works better if Cache is already generated.
For this you just need to enable Critical CSS, and if your page is not cached and when it starts to cache, Critical CSS will start to generate in parallel too, and after a few seconds of generation of Cache, Critical CSS will be updated in the Cache files.
Critical CSS generated this way won't reflect in the Cache immediately, it may take 30 seconds if Critical CSS generation is successful.
These are all the possible ways to generate Critical CSS for your WordPress site and improve your First Contentful Paint(FCP).
If you face any issues related to Generation of Critical CSS or have query related to it, you can contact us at [email protected]