Docs – SpeedyCache https://speedycache.com WordPress Cache Plugin Fri, 02 Jan 2026 10:42:34 +0000 en-US hourly 1 https://sitepad.com/?v=5.1.6 https://speedycache.com/sitepad-data/uploads/2022/03/cropped-site-logo-2-32x32.png Docs – SpeedyCache https://speedycache.com 32 32 Running Cache Lifespan at specific time https://speedycache.com/docs/caching/running-cache-lifespan-at-specific-time Fri, 11 Oct 2024 09:35:31 +0000 https://speedycache.com/docs/caching/running-cache-lifespan-at-specific-time

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.

How Cache lifespan works?

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.

How to make sure Cache lifespan works?

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>&1

Once 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]

]]>
How to Remove Unused CSS https://speedycache.com/docs/file-optimization/how-to-remove-unused-css Thu, 19 Oct 2023 12:52:58 +0000 https://speedycache.com/docs/file-optimization/how-to-remove-unused-css

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.

Unused CSS Issue
  • In your WordPress admin go to SpeedyCache --> File Optimization.
  • Now enable Unused CSS option, and a popup will open which will ask you on how to load unused css, you can choose from the 3 options remove being the most aggressive one.
  • You can exclude some scripts of select some based on the need and then you can save it.

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:-

  • Load the Unused CSS Asynchronously
  • Load on User Interaction
  • Remove All Unused CSS from the Page.

Removing is the most aggressive option, and results in faster speed of the page compared to the other 2 options.

Remove Unused CSS settings popup

 Other than that Unused CSS feature has 2 more options Exclude Stylesheets and Include selectors.

Exclude Stylesheets

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.

Include Selectors

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.

]]>
How to Lazy Render HTML Elements https://speedycache.com/docs/file-optimization/how-to-lazy-render-html-elements Tue, 08 Aug 2023 08:25:42 +0000 https://speedycache.com/docs/file-optimization/how-to-lazy-load-html-elements

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.

Lazy Render HTML element enabled in File Optimization tab

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.

Lazy Render HTML Selector

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.

Lazy Render HTML through CSS

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]

]]>
How to remove WooCommerce Assets https://speedycache.com/docs/bloat-remover/how-to-remove-woocommerce-assets Mon, 10 Jul 2023 13:06:57 +0000 https://speedycache.com/docs/bloat-remover/how-to-remove-woocommerce-assets

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.

Disabling WooCommerce Assets

  • In your WordPress admin go to SpeedyCache --> Bloat tab.
  • Now enable Disable WooCommerce Assets and save the settings.
  • Now WooCommerce assets wont load on pages where they are not needed.
Disable WooCommerce assets settings

If you face any issue do let us know at [email protected]

]]>
How to remove jQuery Migrate in WordPress https://speedycache.com/docs/bloat-remover/how-to-remove-jquery-migrate-in-wordpress Mon, 10 Jul 2023 12:46:20 +0000 https://speedycache.com/docs/bloat-remover/how-to-remove-jquery-migrate-in-wordpress

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.

Removing jQuery Migrate

We are assuming here that you have already installed SpeedyCache on your WordPress site

  • In your WordPress admin go to SpeedyCache --> Bloat tab.
  • Now enable Disable jQuery Migrate and save the settings.
  • Now jQuery Migrate wont load on the frontend of your website(the side your users will visit).
Disable jQuery Migrate setting field

If you face any issue feel free to contact our support at [email protected]

]]>
Bloat Remover https://speedycache.com/docs/bloat-remover Mon, 10 Jul 2023 12:38:55 +0000 https://speedycache.com/docs/bloat-remover How to Delay JS until user interaction https://speedycache.com/docs/file-optimization/how-to-delay-js-until-user-interaction Fri, 07 Jul 2023 09:19:00 +0000 https://speedycache.com/docs/file-optimization/how-to-delay-js-until-user-interaction

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.

Delay JS

To delay JS in your WordPress site follow these steps:-

  • In your WordPress admin go to SpeedyCache  -> File Optimization Tab.
  • Once on the File Optimization tab find Delay JS option and enable it.
Delay JS option in the SpeedyCache File Optimization tab
  • You will see a popup, there you will have to choose if you want to delay selected scripts or all scripts.
  • Delaying all Scripts is an aggressive option but it can break your site too because it may delay a script on which rendering of your website is dependent on.
  • If you select Delay Selected, then you will need to add the scripts you want to delay as it will delay only specific scripts only.
A Popup for the settings of Delay JS with selected JS option selected
  • If you select Delay All then you can test the changes in test mode and then exclude the scripts which are causing any issue in normal rendering of your website.
Delay JS settings with Delay all JS selected

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:-

  • Mouse Over
  • Click
  • Key Down
  • Wheel
  • Touch Move
  • Touch Start

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]

]]>
Object Cache Configuration https://speedycache.com/docs/object-cache/object-cache-configuration Fri, 28 Apr 2023 11:17:47 +0000 https://speedycache.com/docs/object-cache/object-cache-configuration

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.

Requirments

  • Redis extensions for PHP
  • Redis server running on your hosting server.

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.

Object Cache Options

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.

]]>
Object Cache https://speedycache.com/docs/object-cache Fri, 28 Apr 2023 11:17:26 +0000 https://speedycache.com/docs/object-cache How to Generate Critical CSS https://speedycache.com/docs/file-optimization/how-to-generate-critical-css Mon, 20 Mar 2023 12:58:24 +0000 https://speedycache.com/docs/file-optimization/how-to-generate-critical-css

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.

How to generate Critical CSS

There are 3 ways Critical CSS can be created

  • Using create now action in Settings tab under File Optimization Section
  • Directly whenever cache is created

Using Create Now action

This method is Works better if Cache is already generated.

  • In SpeedyCache Go to -> File Optimization tab.
  • In there enable Critical CSS and Save settings.
  • Once settings are saved now you can either click on Create Now action to preload the Critical CSS.
  • You can check the Logs too, it stores the logs of last 10 Critical CSS generation requests.
SpeedyCache Critical CSS Create Now

Critical CSS on Cache Creation

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]

]]>