Widget Cache – Reduce the Number of SQL Queries

Widget Cache – Reduce the Number of SQL Queries

by admin

The Widget Cache feature is available in the premium version. You can reduce the number of sql queries with this feature.

When “Cache System” is enabled, the page is saved as a static html file, thus PHP and MySQL does not work for the page which has been cached. MySQL and PHP work to generate the html of the other pages which have not been cached yet.

Every time before the cache is created, the same widgets are generated again and again. This feature avoids generating the widgets again and again to reduce the sql queries.

1. How to Exclude a Widget?

Although you have excluded the widget cache option, you may not be able to see the current data. If the content of a widget is printed directly on the screen via PHP, you cannot see the latest data since the whole page is saved as a static html file.

You should get the data via Ajax request instead of PHP directly to solve this problem.

Note: The widget panel has been changed after v5.8 of WordPress so you need to use the Classic Widgets Plugin to use this feature.

2. What Happens After Update a Widget?

If you update a widget, the widget cache folder which is /wp-content/cache/wpfc-widget-cache/ is deleted.

3. How to Clear Widget Cache?

We did not add this feature not to confuse. You can clear the widget cache with two ways;

1. if you clear cache, the widget cache is cleared as well
2. if you update a widget, the widget cache is cleared

4. How to See the Number of DB Queries?

If you wanna see the the number of database queries during the WordPress execution, you should add the following line into the footer.php of theme file.

<?php echo get_num_queries();?>

Related articles

Placeholder Image
Combine JS Plus

The feature minifies the combined js files which are in footer.

Placeholder Image
Render Blocking Js

Automate Image Optimization
Automate Image Optimization

You can optimize images automatically, instead of manually optimizing them via the image optimizer.

Ready to get started?

Purchase your first license and see why 1,500,000+ websites globally around the world trust us.