Libelektra: XDG compatibility of cache

Created on 18 Jun 2019  路  5Comments  路  Source: ElektraInitiative/libelektra

Simple question: Is there any way to tell the cache plugin to use $XDG_CACHE_HOME/elektra instead of ~/.cache/elektra?

question

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markus2330 picture markus2330  路  27Comments

kodebach picture kodebach  路  29Comments

ingwinlu picture ingwinlu  路  35Comments

markus2330 picture markus2330  路  49Comments

ghost picture ghost  路  29Comments