.clear() and .expireObject() in CacheBox

Can someone explain the difference between clearing and expiring an
object in the cacheBox cache? The description in the docs are too
vague to tell me what's really going on:

expireObject

public void expireObject(any objectKey)
Expires an object from the cache by using its cache key. Returns false
if object was not removed or did not exist anymore (if supported by
the provider)

clear

public boolean clear(any objectKey)
Clears an object from the cache by using its cache key. Returns false
if object was not removed or did not exist anymore

Nowhere in the wiki could I find a definition of how clearing and
expiring differ.

Thanks,

Dan

Clearing removes the object and stats immediately. Expiration marks them for death. They will be removed completely on the next reaping iteration.

This is only valid for the cache box provider

Luis Majano
President
Ortus Solutions, Corp
Toll free phone/fax: 1-888-557-8057
Mobile: 909-248-3408

www.coldbox.org

Is there a benefit to one over the other? If an item is expired, a
lookup will fail, and I can regenerate the cached key, correct? If so,
am I better off just expiring and letting the normal reaping take care
of things, or do I need to .clear() the key to make sure that the next
request will regenerate the key?

Thanks,

Dan

I would recommend clearing directly.

Thanks, I appreciate the quick response.

Dan