Proxy_Cache::get_cache_key( WP_REST_Request $request, string $cache_group )

Summary

Build a cache key from request args.


Parameters

$request

(WP_REST_Request) (Required) Request instance.

$cache_group

(string) (Required) Cache group name.


Return

(string) Cache key.


Source

File: src/BigCommerce/Proxy/Proxy_Cache.php

	public function get_cache_key( $request, $cache_group ) {
		$path = $this->get_request_route_path( $request );

		$key = $path . ':' . md5(
			wp_json_encode(
				[
					'params' => $request->get_params(),
					'header' => $request->get_headers(),
				]
			)
		) . ':' . $this->get_generation( $cache_group );

		return $key;
	}


User Contributed Notes

You must log in before being able to contribute a note or feedback.