Generates and assigns a cache key to an object that will be cached.
INKReturnCode INKCacheKeyDigestSet(INKCacheKey
key
, const unsigned char
*input
, int
length
)
INKCacheKey
is the key that will be
associated with the cached object. Before calling
key
INKCacheKeyDigestSet
, you must create the
key with INKCacheKeyCreate
. Note that in
order to generate unique keys, you must use unique input
strings. This means that if the input strings are identical, then
INKCacheKeyCreate
generates identical
keys.
const unsigned char
*
is a
character string that uniquely identifies the object. In most
cases, it's the URL of the object.input
int
is the
length of the input string.length
Generates and assigns a cache key to the object to be cached.
INK_SUCCESS
if the cache key is successfully
generated.
INK_ERROR
if INKCacheKeyDigestSet
cannot be set.
const char *digest_string = "mydigest" INKCacheKey mykey; INKCacheKeyCreate(&mykey); INKCacheKeyDigestSet(mykey,digest_string, strlen(digest_string);