Home

Traffic Server Software Developers Kit

INKCacheReady

Determines if the Traffic Server cache is initialized and ready to accept requests for the specified data type.

Prototype

INKReturnCode INKCacheReady (int *is_ready)

Arguments

If the cache is ready, then the int *is_ready argument is set to a non-zero value. It is set to 0 if the cache is not ready.

Description

Asks the Traffic Server cache if it is initialized and ready to accept requests. If the cache is not initialized, then any attempts to read, write, or remove documents will fail.

When a plugin starts (i.e., when its INKPluginInit function is called), there is no guarantee that the cache is already initialized. This API is useful if a plugin needs to access the cache from the INKPluginInit function. If the cache is not ready, then the plugin should retry later.

Returns

INK_SUCCESS if the API is called successfully.

INK_ERROR if this function cannot be set or if it is invalid.