XnView Multi Platform places thumbnail cache in config directory instead of cache directory
Posted: Thu Feb 09, 2023 10:33 am
I found that XnView Multi Platform stores thumbnail cache in ~/.config/xnviewmp/Thumb.db file. This is semantically incorrect. This file is essentially a cache and therefore should be placed in cache directory. See XDG Base Directory Specification for how is should be handled.
Basically the app should read cache directory location from XDG_CACHE_HOME env variable and if it is not set use "$HOME/.cache" as default.
Downsides of not following XDG_CACHE_HOME standard.
In my case:
Looks like XDG_CONFIG_HOME is not handled as well. But it should be used according XDG Base Directory Specification. It allows a user run the app with different sets of config options in different circumstances.
Basically the app should read cache directory location from XDG_CACHE_HOME env variable and if it is not set use "$HOME/.cache" as default.
Downsides of not following XDG_CACHE_HOME standard.
In my case:
- Thumb.db is included in backups inflating their size and increasing backup time. ~/.cache directory is excluded from backups
- I use snapper for hourly snapshots of my $HOME. ~/.cache is deliberately excluded from snapshots and ~/.config is snapshotted. Due to incorrect location of thumbnail cache and storing each hourly version of it it takes 3x times more space on filesystem than its current size.
Looks like XDG_CONFIG_HOME is not handled as well. But it should be used according XDG Base Directory Specification. It allows a user run the app with different sets of config options in different circumstances.