Simple question: Is there any way to tell the cache plugin to use $XDG_CACHE_HOME/elektra instead of ~/.cache/elektra?
No, unfortunately not. Currently the resolver resolves the home directory, and the ".cache/elektra" below is hardcoded.
Thank you for the question and answer.
As it is a global plugin, we could actually also easily make it configurable via /elektra/cache/path or similar.
And maybe also /elektra/cache/disable, then we would not need tools for caching at all?
rm -rf `kdb get /elektra/cache/path`
sounds a bit dangerous, though. So maybe one tool for cleaning the cache.
Sounds good to me!
So maybe one tool for cleaning the cache.
That should not be a problem, especially if the path is configured in /elektra/cache/path.
Would it be sufficient if it respects XDG_CACHE_HOME instead of adding a /elektra/cache/path config as well? The XDG part is implemented now.
Yes, for now it should be fine, it fixes this issue.
For long term (maybe even after 1.0) I would prefer if Elektra's configuration would be completely specified, without any bypasses like env vars. Then people could specify that the path should be static or from the env var XDG_CACHE_HOME, as preferred. I am not sure if this would already work with the gopts plugin or if there are some bootstrapping issues (cache getting the key before gopts had a possibility to run).
For now, however, we should focus on that applications, i.e. our users, can specify everything. This is also more easy to implement, as no bootstrapping issues occur.