PHP 클래스 WC_Cache_Helper

저자: WooThemes
파일 보기 프로젝트 열기: woocommerce/woocommerce 1 사용 예제들

공개 메소드들

메소드 설명
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 ( )