Returns the cache identifier (cache key) for a cached object.
This ID can be used with `cacheRemove()` to manually flush the cache entry.
Works with cached queries, functions, and HTTP results.
For cached functions, the cache ID is unique per combination of function and arguments.
Lucee Function Reference
cachedwithinid()
Example
cachedwithinid(any cacheObject,[any arguments]):String
Arguments
The arguments for this function are set. You can not use other arguments except the following ones.
| Name | Type | Required | Description |
|---|---|---|---|
| cacheObject | any | Yes |
The cached object to retrieve the cache ID for. Must be a valid cache object such as a query result, function reference, or HTTP result struct that was cached using the `cachedwithin` attribute. |
| arguments | any | No |
The arguments used when the cache entry was created. Required for cached functions to identify the specific cache entry, as each unique set of arguments creates a separate cache entry. Can be provided as an array `[arg1, arg2]` for positional arguments or as a struct `{key: value}` for named arguments. Not required for queries or HTTP results. |