Does anyone have a Query Cache Busting page they h...
# lucee
d
Does anyone have a Query Cache Busting page they have created? Something that would allow users to go and selectively bust the cache of queries when needed? Feels like that would make a good module. I don’t see something up on Forgebox already.
s
The pattern here is usually 'flush cache on (some user action)' rather than making the user elect a cache flush. I.e., this data belongs to Foo Cache, and on (various foo actions) we auto-flush it. Building a module dependent upon the user pushing a 'bust cache' button seems like a funky solution to the problem
d
We do what you are describing too for the common stuff (cache the things when you get it, bust it when something gets updated within the app). We have some stuff that is updated externally or is updated so infrequently that we don’t have a UI built around it and it is just done in the database. It’d be nice to be able to cache those kind of queries for like a month or a year or something but be able to bust it easily if it does happen to get updated.
Does that make sense?
s
Sure. It's a reasonable use case. Just probably not a common one, given the availability of interceptors, DB triggers, etc. So idk how much use a module would get, but certainly more use than no module would get. 🙂
d
I also imagine there are quite a few folks who throw cachedWithin on a bunch of queries because it garners a quick win and haven’t implemented any kind of cache-busting into the app at all (we might have been those folks in the past 😄 ). So I bet there is a decent use case for it, but could be wrong. There is at least our current use case for it, ha.
z
you can use tags, it's been there for ages, just hidden till 5.3.10 https://luceeserver.atlassian.net/browse/LDEV-4027 only thing is your cache backend might not index tags which ends up being slow
d
We do use tags, but they don't seem to be included with the cache properties or metadata.
@zackster If the tags did show up somewhere, that would be fantastic. Or am I missing something?
z
that's all background. you're saying it works and that info is a nice to have?
d
The tag functionality works if you’re using the cachedWithin and cacheClear. But if I wanted a cache busting page that shows what is currently in the cache, I can’t view the “tags” on that page to help know what to bust.
Yeah, neither of them show the tags stuff. It would be nice if they did.
z
CacheGetMetadata should be easy enough, as it's just adding a key to the result set
d
Or is there a quick video or something showing these steps?
z
100% current