2020-12-31

Caches to Ashes

#data

#software

Cache eating disk space

A few days back I realized, that emacs or some component of it would keep files in ~/.emacs.d/url/cache/$USER. I found a variable to timeout the cache content (url-cache-expire-time). But apparently that does not mean that the cache is cleared after timeout. Nor is it cleared on emacs exit or new start.

So I looked further, knowing that there is ~/.cache as well.

$ du -sk .cache
1380124  .cache/

1.3 GiB of cached files. WTF???

A Cache is a Cache

So in my little world, a caches content is ephemeral. A cache can be deleted any time and will be rebuild whenever needed. So yesterday evening I did just that:

rm -fr .cache/ .emacs.d/url/cache/

before logging out.

Or rather not?

This morning, firing up emacs/mu4e failed. Checking the *Messages* buffer revealed, that mu4e was searching for files in ~/.cache/mu and bailed out. So at least the error message made it clear immediately: .cache/mu is not a cache, it is a long time storage place. Sigh.

To fix this I had to "mu init" and "mu index" my message store again. Inspecting the documentation revealed a helpful option: "--muhome=~/.mu". So I added that.

mu init --maildir=~/ePost/Maildir --muhome=~/.mu  --my-address="ew.gemini@nassur.net" ...
mu index --maildir=~/ePost/Maildir --muhome=~/.mu

Plus I had to inform emacs/mu4e about this new setting

(use-package mu4e
    :config
    (setq
      mu4e-mu-home (expand-file-name "~/.mu")
    )

I wonder, what else is going to break by deleting ~/.cache ...

Cheers,

~ew

Home