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