PHP Класс WC_Cache_Helper

Автор: WooThemes
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
delete_version_transients ( $version = '' ) When the transient version increases, this is used to remove all past transients to avoid filling the DB.
geolocation_ajax_get_location_hash ( ) : string Get a hash of the customer location.
geolocation_ajax_redirect ( ) When using geolocation via ajax, to bust cache, redirect if the location hash does not equal the querystring.
get_cache_prefix ( string $group ) : string Get prefix for use with wp_cache_set. Allows all cache in a group to be invalidated at once.
get_transient_version ( string $group, boolean $refresh = false ) : string Get transient version.
incr_cache_prefix ( string $group ) Increment group cache prefix (invalidates cache).
init ( ) Hook in methods.
notices ( ) notices function.
prevent_caching ( ) Prevent caching on dynamic pages.

Приватные методы

Метод Описание
get_page_uris ( string $wc_page ) : array Get the page name/id for a WC page.
nocache ( ) Set nocache constants and headers.

Описание методов

delete_version_transients() публичный статический Метод

Note; this only works on transients appended with the transient version, and when object caching is not being used.
С версии: 2.3.10
public static delete_version_transients ( $version = '' )

geolocation_ajax_get_location_hash() публичный статический Метод

Get a hash of the customer location.
public static geolocation_ajax_get_location_hash ( ) : string
Результат string

geolocation_ajax_redirect() публичный статический Метод

This prevents caching of the wrong data for this request.
public static geolocation_ajax_redirect ( )

get_cache_prefix() публичный статический Метод

Get prefix for use with wp_cache_set. Allows all cache in a group to be invalidated at once.
public static get_cache_prefix ( string $group ) : string
$group string
Результат string

get_transient_version() публичный статический Метод

When using transients with unpredictable names, e.g. those containing an md5. hash in the name, we need a way to invalidate them all at once. When using default WP transients we're able to do this with a DB query to. delete transients manually. With external cache however, this isn't possible. Instead, this function is used. to append a unique string (based on time()) to each transient. When transients. are invalidated, the transient version will increment and data will be regenerated. Raised in issue https://github.com/woocommerce/woocommerce/issues/5777. Adapted from ideas in http://tollmanz.com/invalidation-schemes/.
public static get_transient_version ( string $group, boolean $refresh = false ) : string
$group string Name for the group of transients we need to invalidate
$refresh boolean true to force a new version
Результат string transient version based on time(), 10 digits

incr_cache_prefix() публичный статический Метод

Increment group cache prefix (invalidates cache).
public static incr_cache_prefix ( string $group )
$group string

init() публичный статический Метод

Hook in methods.
public static init ( )

notices() публичный статический Метод

notices function.
public static notices ( )

prevent_caching() публичный статический Метод

Prevent caching on dynamic pages.
public static prevent_caching ( )