As I’ve been upgrading Fedora from 40 to 41 and now to 42 under KDE 6.4.0, I’ve noticed really old qmlc files continue to build up under ~/.cache/ in the qmlcache folders.
Shouldn’t there be some kind of clean up of those?
I’ve made a bash function to give me a sane way to flush out really old cached files. The first time I checked these files I was seeing qmlc files up to years old.
function cleanupkdecaches()
{
agedays="180"
if [[ -n "$1" ]]; then
agedays="$1"
fi
echo "cache files shown below are over $agedays days old"
readarray qmldirs < <(find ~/.cache -type d -name "qmlcache" ! -empty)
for qdir in ${qmldirs[@]}
do
# only show the files that are old
find $qdir -type f -name "*.qmlc" -mtime +$agedays -print
done
read -p "Enter Y to accept deleting these files " ANS
if [[ "$ANS" == 'Y' ]]; then
for qdir in ${qmldirs[@]}
do
find $qdir -type f -name "*.qmlc" -mtime +$agedays -delete -print
done
else
echo "Aborting"
fi
}
Is it a good idea to occasionally flush old qmlc files (like here > 180 days)?
I think this is a good idea in general not just for one type of files specifically.
Maybe something that runs at the end of a session (logout, reboot, shutdown).
I actually wonder if systemd doesn’t already have that in some way.
In any case it would probably need to check access time instead of modification time.
A cache file could be very old yet still valid for whatever “source” it was built from.
Since I started using KDE Plasma, I saw some mysterious bugs that are difficult to reproduce due to those old files in “~/.cache” folder, it often happens after a major Plasma upgrade, and what I learned to do is: After finishing any major upgrade, logout then switch to another tty and clean the whole “~/.cache” via rm -rf ~/.cache/ then reboot, the next Plasma boot will be a little slower but you will be safe.
the first thing i do when things don’t seem to be going the way they should is just delete the whole ~/.cache folder.
there’s nothing in there i need to worry about losing.
it would be good to know if there were some kind of automated clean up tho.
when i ran the above script i had to dial the days down below 30 days old before it picked up any files… and i don’t know if that’s because the system cleans up of files older than 30 days or just coincidence.
the first thing i do when things don’t seem to be going the way they should is just delete the whole ~/.cache folder.
I wasn’t sure if that was safe to do, so I was using the function to just delete the old files taking a 1/2 year as old.
But since fresh installs are obviously a thing, it has to be okay to have an empty or even nonexistent ~/.cache but I was thinking there might be a retained thing like related to email that might be a mistake to just delete.
I logged out of KDE and simply deleted the ~/.cache entirely and logged back in. I don’t see any negative effects. After I ran Discover again, the number of qmlc files is now 294 and all new ones. What I’m wondering is, do obscure bugs happen if old qmlc files are left in there or is it’s just nothing but a waste of space?
Thumbnails of web browsers and Dolphin and browser cache are gone.
I have all dolphin thumbnails turned off except a few image types like png, jpg.
It never made sense to me to show previews of documents or exes (what good is a preview of a binary file that’s not an image?)
having a thumbnail preview of PDF cover page, or a view of the spreadsheet you were working on are handy visual cues that help me find the file i’m looking for faster than having to read the file name.
but i’m a visual person with dyslexia so reading is somewhat more difficult than recognizing patterns.