Cache Expiry Filters

When caching is enabled. The cache expiry time can be changed by adding filters. The filters in the table below are the filters that can be used depending on which expiry time needs to be changed.

Default values for all this filters is 12 hours but converted int an equivalent number of seconds using 12 * HOUR_IN_SECONDS (HOUR_IN_SECONDS is a core WordPress constant).

Example Usage: All the filters in the table below provide one integer value you can modify or replace with your own expiry time

<?php
add_action( 'slswc_get_product_details_cache_expiry', function( $expiry_time ) {
      $expiry_time = 2 * HOUR_IN_SECONDS; // Change the expiry to 2 hours
      // OR
      $xpiry_time = $expiry_time * 2;
      
      // return the modified expiry_time
      return $expiry_time;
} );

In the example, slswc_get_product_details_cache_expiry can be replaced with any of the filter names in the left column on the table below depending on what you wish to do.

Filter NameDescription
slswc_get_license_cache_expiryCache expiry for the results a get license query.
slswc_get_product_details_cache_expiryProduct details cache expiry.
slswc_check_for_update_cache_expiryUpdate chec cache expiry time
slswc_activate_license_cache_expiryLicense activation cache expiry
slswc_deactivate_license_cache_expiryLicense deactivation query cache expiry
slswc_get_licenses_cache_expiryGet license results expiry
slswc_customer_licenses_cache_expiryCached customer licenses expiry
slswc_licenses_where_cache_expiryConditional license query expiry
slswc_total_licenses_cache_expiryTotal licenses expiry
slswc_total_activations_cache_expiryTotal number of activations expiry.
slswc_total_live_activations_cache_expiryTotal live activations.
slswc_total_staging_activations_cache_expiryTotal staging activations.
slswc_licenses_for_order_cache_expiryLicense for order.
slswc_get_licensed_customer_ids_cache_expiryLicensed customer ids.
slswc_get_licensed_customer_details_cache_expiryLicensed customer details
slswc_get_expiring_customers_cache_expiryExpiring customers
slswc_signup_count_cache_expiryNumber of signups
slswc_renewal_count_cache_expiryNumber of renewals.
slswc_get_customers_within_range_cache_expiryCustomers within range
slswc_get_customers_at_start_cache_expiryCustomers at start of range
slswc_get_customers_at_end_cache_expiryCustomers at end of range
Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support
Scroll to Top