Clearing CFFunction "CachedWithin"?

I’ve been using the cachedWithin on some function calls that do some consistent hashing. But, I’m finding that if I change the logic of the hashing, I need to change the name of the function in order to see it get reprocessed. I’m wondering if there is a way to clear the cache used by the cachedWithin settings? I’ve tried “clearing” all the options in the Server/Web admin for cache/performance, but nothing seems to affect it.

I know that once this goes to production, it won’t be an issue; but, during development, it would be nice to be able to clear the cache.

Have you tried using SystemCacheClear()? SystemCacheClear :: Lucee Documentation

I’ve never used it, but it looks like it allows for functions as one of the caches you can pass to it. I am not aware of anything in the admin UI for clearing function cache.


Ha, literally never seen this function before in my life :smiley: I’ll try it out, thanks!

I am not sure if this is implemented yet, but I think there was an idea of adding the tags attribute so you could then clear by tag (so for example you could clear the cache of all “userProfile” tagged queries and functions) using CacheClear ( see CacheClear :: Lucee Documentation )
It’s certainly is in cfquery <cfquery> :: Lucee Documentation but I guess not in cffunction. I must pester @micstriit about this.

1 Like

Oh man, there’s a bunch of caching functionality that I’m not familiar with. I’ll dig into this, thanks!

if it’s not in jira, it’s not a bug :slight_smile:


Unfortunately, systemClearCache( "function" ) does not see to help :frowning: It was a good thought, though!

well it should! file a bug

Does it work via the admin? If so, there there’s a cfadmin function to do it

From what I recall, when looking in the admin under caching, it always said 0 next to the Function cache, even when using cachedWithin on the functions. That was one of the first places I looked :smiley: