I wanna put /var/cache in tmpfs to avoid SSD wear off and speed up my operation (as RAM so much faster than SSD). is this safe to do so? Anyone here did so? How much space should I dedicate? What caveats I can get?
You don’t really need to move /var/cache to tmpfs anymore. Most modern distros (including Ubuntu 22.04 LTS) already use tmpfs for things like /tmp and rely on zram/zswap to cut down SSD writes.
Putting the whole /var/cache in RAM just means you’ll lose useful caches every reboot and force extra downloads/rebuilds, which usually slows things down instead of speeding them up.
If you’re interested in the broader topic of reducing SSD wear, I wrote up some notes here that might help: