Just as the title says. How do I delete the cache folder in the home directory automatically?
To my understanding.
Does it make sense to delete the entire folder?
I have seen a post somewhere here recommending to make an entry in the fstab with tmpfs. I just can’t remember where. Does that make sense?
I would prefer to delete the folder on shutdown.
If this option makes sense, what is the best way to proceed?
I use yay myself and it gets deleted as well, never had any issues using this method as I have been using it for years. After using yay, I noticed that the yay folder is created and usually around 2 MiB to 7.7 MiB in size.
I have no experience with self-created systemd services. I will make an entry in fstab. Thank you very much, at some point i will read up on systemd services to get an understanding of it
That worked exactly as intended. .cache is almost empty after booting except for the usual cache files for Plasma, which are reloaded. As soon as I start an application, such as strawberry, a new file is automatically created in the .cache folder. So the cache always stays clean.
I would just ask why do you want to delete cache on a shutdown? It is there to speed up some software’s start time. Some files (e.g. yay or pip packages) may require download from the internet which may not be ideal on every startup.
After emptying the cache, it is rebuilt and the ssd is not overwritten many times but rewritten. It doesn’t matter to me if something has to be downloaded again. I think it only takes milliseconds to start programs. I have this time