The tmpfs facility allows the creation of filesystems whose contents reside in virtual memory. Since the files on such filesystems typically reside in RAM, file access is extremely fast.
to run a directory or file in tmpfs you need to edit /etc/fstab
tmpfs /tmp tmpfs nodev,nosuid,noexec,nodiratime,size=5G 0 0
tmpfs /home/user/.cache tmpfs nodev,nosuid,noexec,nodiratime,size=5G 0 0