Home

Traffic Server Software Developers Kit

INKCacheRemove

Removes an object from the Traffic Server cache.

Prototype

INKAction INKCacheRemove (INKCont contp, INKCacheKey key)

Arguments

INKCont contp is the continuation the cache calls back when reporting the success or failure of the remove.

INKCacheKey key is the cache key that corresponds to the object tol be removed.

Description

Removes the object corresponding to key from the cache.

If the object was removed successfully, then the cache calls contp back with the event INK_EVENT_CACHE_REMOVE.

If the object was not found in the cache, then the cache calls contp back with the event INK_EVENT_CACHE_REMOVE_FAILED. An error code is passed in the void *edata argument of contp. The error code can be:

  • INK_CACHE_ERROR_NOT_READY: tried to access the cache before it was initialized.

  • INK_CACHE_ERROR_NO_DOC: doc doesn't exist in cache

  • any other value: unknown remove failure

In both of these callbacks, the user does not have to do anything. The user does not get a vconnection from the cache, since no data needs to be transferred. When the cache calls the user back with INK_EVENT_CACHE_REMOVE, the remove has already been committed.

[Note] Note

Reentrant calls are possible, i.e. the cache can call back the user (contp) in the same call.

Returns

An INKAction object if successful.

INK_ERROR_PTR if an argument is incorrect or if the API fails.