get_wp_cache_key()WPSCache 1.0

No Hooks.

Return

null. Nothing (null).

Usage

get_wp_cache_key( $url );
$url **
-
Default: false

get_wp_cache_key() code WPSCache 1.12.0

function get_wp_cache_key( $url = false ) {
	global $wp_cache_request_uri, $wp_cache_gzip_encoding, $WPSC_HTTP_HOST;
	if ( ! $url ) {
		$url = $wp_cache_request_uri;
	}
	$server_port = isset( $_SERVER['SERVER_PORT'] ) ? intval( $_SERVER['SERVER_PORT'] ) : 0;

	// Prepare a tag to include in the cache key if the request is anything other than text/html
	$accept = wpsc_get_accept_header();
	if ( $accept === 'text/html' ) {
		$accept_tag = '';
	} else {
		$accept_tag = '-' . $accept;
	}

	return do_cacheaction(
		'wp_cache_key',
		// phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
		wp_cache_check_mobile( $WPSC_HTTP_HOST . $server_port . preg_replace( '/#.*$/', '', str_replace( '/index.php', '/', $url ) ) . $wp_cache_gzip_encoding . wp_cache_get_cookies_values() . '-' . wpsc_get_accept_header() . $accept_tag )
	);
}