←  All Add-Ons
Caching - Gridbuilder ᵂᴾ

Speed up loading time when filtering grids or templates by caching content and facets. Caching add-on boost performances by storing queried content in a custom table.

Key features

  • Cache content for all asynchronous requests
  • Clear cache individually on each page
  • Clear cache globally for all pages
  • Exclude facets or grids from cache
  • Control the cache lifespan
  • WP-CLI command to clear cache


Once the add-on activated, a new “Caching” menu will appear in the global settings of WP Grid Builder. And a menu in the admin bar, to clear the cache, will be available.

By default, the plugin will cache all requests from all your grids and facets. But, you can exclude grids and facets in the global settings.

We recommand to exclude Search facets from cache to prevent caching an infinite number of results. Because, filtering combinations are endless with a search facet.


Cache - Global settings
Cache – Global settings
Cache - Admin menu
Cache – Admin menu
Cache - HTTP header
Cache – HTTP header


This add-on comes with several PHP filters to easily customize the cache behaviour.

Bypass the cache:

function prefix_bypass_cache( $bypass, $atts ) {

	// If facet slug 'search' has values, do not cache.
	if ( ! empty( $atts['facet_args']['search'] ) ) {
		return true;

	return $bypass;

add_filter( 'wp_grid_builder_caching/bypass', 'prefix_bypass_cache', 10, 2 );

Change the cache lifespan:

function prefix_cache_lifespan( $interval ) {

	// Lifespan in seconds.
	return 24 * HOUR_IN_SECONDS;

add_filter( 'wp_grid_builder_caching/lifespan', 'prefix_cache_lifespan', 10, 2 );

Change the cron interval used to cleanup expired cache content:

function prefix_cron_interval( $interval ) {

	// Interval in seconds.
	return 30 * MINUTE_IN_SECONDS;

add_filter( 'wp_grid_builder_caching/cron_interval', 'prefix_cron_interval', 10, 2 );

Disable cron jobs, ran each 24 hours, that clear expired cache content:

add_filter( 'wp_grid_builder_caching/cron', '__return_false' );

Easily clear or cleanup cache with WP-CLI:

# Clear whole cache.
$ wp wpgb-caching clear
Success: Cache cleared!

# Clear grid cache from grid id.
$ wp wpgb-caching clear 1234
Success: Cache cleared for 1234!

# Clear grid cache from template id.
$ wp wpgb-caching clear "My Template"
Success: Cache cleared for My Template!

# Cleanup cache (expired content).
$ wp wpgb-caching cleanup
Success: Cache cleaned up!



Release date: March 25, 2019

  • addedNew automatic purge option.
  • addedSupport for WP Grid Builder v1.2.1
  • fixedWarning when creating custom table on activation.


Release date: November 5, 2019

  • fixedIssue with custom table creation.


Release date: November 4, 2019

  • released Public Release