[stable7] Refactor cache updater to work outside of the users home

Backport of #10145

cc @DeepDiver1975 @PVince81