I am using the lucee redis extension and need to a...
# lucee
b
I am using the lucee redis extension and need to add prefixes to the keys but am not seeing a way to add that - https://github.com/lucee/extension-redis/blob/ed92a0065897a692a0ec82b57d966dec78f88df7/build/context/admin/cdriver/Redis.cfc Am I wrong about where prefixes would be defined? i.e., is it defined on the cache somehow vs the custom redis settings?
d
I don't see any code for doing custom key prefixes. Why custom prefixes? Can't use custom caches instead?
b
If it were just a normal cache maybe? Im using it for session storage (and recovery when pods crash). The devops guys are setting up a redis cluster in each of our VPCs (for example, SDLC VPC has Dev and QA in it, then staging and prod in one). They wanted the keys to be prefixed with environment for organizational purposes.
🤘 1
I am not sure if that is just a visual thing for filtering or if prefixes helps keep things together better in their memory spaces ( ¯\_(ツ)_/¯ ) . Without prefixes, the best I can do is add a suffix by appending environment to the application name (application name is the last thing in the auto-generated key names)
d
I getcha. FWIW I like the idea of the env being part of the application name, as it seems to be in the same "bucket" as the cache, if you will, and since so many other things log it.
b
I'll have to look more into prefixes and talk to these guys again. If the prefix is a PREfix for a reason, a suffix may be a waste (outside of being able to filter keys in redis-cli or whatever by names like *-qa )
d
Yeah, plus, if you have lots of logic tied to the application name adding the env might have unwanted knock-on effects. A lot depends on how you have things distributed too.
I'd probably have separate caches to avoid having to do searches for stuff but that too might have knock-on effects.
b
being a session storage cache, how would you name it at all?
i mean, its a named lucee cache i called "sessionCache" then used this.sessionStorage = "sessionCache". Are you saying that name is also being used by Redis internally somehow?
I've used in memory caches plenty but this is the first time Ive used redis or stored sessions in a storage cache.
...yeah, seems like "Prefixes" are a bit more special than just a string to make things easy to find.
not just a string prefix but used to organize things internally
d
If you use the redis explorere or whatever it is, what is the session cache named?
b
AFAIK i dont think redis has the concept of cache names. but my keys look like this... lucee-storagesession1c26da85-bd4f-4900-b6e4-9a7322a214f6:minitoolbox So I'm guessing "lucee-storage"?
lucee-storagesession&lt;cfid&gt;<appname>
d
so I guess it's hard-coded in the implementation
d
Yeah prefix and databases was what I was thinking of, and neither look to be settable from that
👍 1
b
Is what it is I guess. If it becomes a big deal, I guess they will just have to make environment-specific clusters 🙂
🤘 1
d
apropos to nothing that reminded me of the funny AWS visual for redis:
the "cluster mode disabled" cluster makes me laugh
b
heh who engages cluster mode in a cluster
d
"that was your first mistake" 😆
I would guess that someone has rolled their own implementation that lets you set the other stuff for redis, tho then you're using that other implementation, versus the built-in one
I love that lucee source code is right there and modifiable — if I were them I'd maybe start with a system/env property so you could at least change the defaults for those
eventually exposing a setting or something in the admin
b
Ortus has a paid redis extension that looks to support prefixes
and theirs DOES expose all of that in the admin UI if you install that too
but ones free heh
🤘 1
Devops when I ask what happens if I dont add prefixes... "You die... she dies.... everyone dies..."
😂 1
🤘
d
I heard that in the voice lol
😆 1
Are you able to use the latest lucee? Maybe they'd take a patch for being able to change the default via an env setting?
b
not yet but upgrade is soon/next
🤘 1