Pins the document corresponding to the specified key in the cache so that the garbage collection process does not delete the document from the cache for the specified number of seconds.
INKReturnCode INKCacheKeyPinnedSet (INKCacheKey
key
, time_t
pin_in_cache
)
INKCacheKey
is
the cache key for the document to be pinned.key
time_t
represents the
number of seconds the document is to be pinned in the
cache.pin_in_cache
Pins the document corresponding to the specified
in the cache for the
specified number of seconds specified in
key
. Once the
document is pinned, the garbage collection will not delete this
document from the specifed number of seconds and the document
can even persist across Traffic Server re-runs. However, after
the pin_in_cache
interval has expired, the cache may delete the document at any
time in order to reclaim space.pin_in_cache
To delete this document before the
interval expires, call the pin_in_cache
INKCacheRemove()
function with the
document’s cache key.
InkCacheKeyPinnedSet()
should be
used after a key is created and before writing the document to
cache using I
NKCacheWrite()
.
Because a document is not pinned in the cache by default, it can be garbage-collected at anytime.
Note | |
---|---|
It is important that the
|
INK_SUCCESS
if the specified object was
successfully pinned in the cache.
INK_ERROR
if the pin could not be set or is
invalid.