Maybe keep it simple and focused on the minimum required for XQuery use :)
From a quick test Jedis seem to work fine from custom/lib [1]

/Andy
[1] https://gist.github.com/apb2006/9563707df4d8f7dd536d9cd3ea70046f



On Tue, 10 May 2022 at 12:26, Christian Grün <christian.gruen@gmail.com> wrote:
;·) About time for BohemiaX.

Similar to Redis, we could either work with expiry dates or limit the
cache to a maximum number of entries (and drop the ones with the
oldest access time).


On Sat, May 7, 2022 at 5:30 PM Andy Bunce <bunce.andy@gmail.com> wrote:
>
> "There are only two hard things in Computer Science: cache invalidation and naming things." [1]
>
> This topic combines the two ;)
> As for alternative names I offer: the exotic: entrepot, the industrial: kvstore, the bohemian: stash. Personally I think cache is fine.
>
> I have sometimes thought of using BaseX and Redis together managed by docker-compose.
> I like the data structures [3] and the concept of 'variables' that self destruct after some time [4]
>
> /Andy
>
> [1] https://www.martinfowler.com/bliki/TwoHardThings.html
> [2] https://en.wikipedia.org/wiki/Entrep%C3%B4t
> [3] https://redis.io/docs/about/
> [4] https://redis.io/commands/expire/
>
> On Fri, 6 May 2022 at 15:26, Christian Grün <christian.gruen@gmail.com> wrote:
>>
>> Hi Liam,
>>
>> > What happens on a crash (e.g. power failure)?
>>
>> If BaseX is shut down gracefully, the data will be stored; otherwise,
>> it might get lost indeed. If the cached data is important, it’s
>> advisable to call cache:write after each update.
>>
>> In the documentation, I mentioned that the cache will automatically be
>> written to disk at shutdown time. Based on some more feedback I got, I
>> imagine there can be cases in which you simply want to create a
>> temporary cache without making it persistent. I think I’ll change
>> this, and I will only serialize the cache if a cache file already
>> exists on disk (as a result of a previous explicit cache:write call).
>>
>> > E/g/ for the listtle teszt/experiment site i have at
>> > www.fromoldbooks.org (and www.fromoldbooks.org/Search/) there's a
>> > framework i wrote that calls out to BaseX and keeps a cached result in
>> > a separate file, one per query. […]
>>
>> By reading your reply and the one from Omar, I wonder if the »Cache«
>> is really the best term to describe what the module offers. It’s
>> basically a Main-Memory Key-Value Store that can be made persistent,
>> similar to e.g. Redis. Suggestions for a better name are welcome.
>>
>> All the best,
>> Christian