fix duplication in log output
prefer getwritablepath() to manual path building
systemize path handling ; improve cache write errors