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.
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.
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.
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
“Develop Mode” in the Lucee admin also doesn’t seem to suppress reading from the function cache.
The Lucee admin reads ‘0’ as someone mentioned earlier, even though the function cache is being read and used.
Lucee CFML is lightning fast on my current project and the performance is amazing, mainly due to selective use of cffunction and cacheWithin, however not being able to clear it is very difficult.
It’s got to a silly level where I’m having to append names to functions to escape the cache, using names like myFunction1 and myFunction2 because I can’t clear the cache for myFunction!
yeah, looking into the code, pretty sure this doesn’t hit the per application caches, only the current application. this bug is related [LDEV-3388] - Lucee
(1) You mentioned this works per-application, so I tried these functions but they also don’t seem to affect the app’s function cache either, interestingly: