However, I was searching for ways to limit the wear of my SSD (since each cell has a limited lifetime with regards to writes). One solution was to store the Safari cache on a RAM drive which will only be written to disk at logout.
Several hints on this site describe a way to store Safari cache on a RAM drive. However, none seemed to work for me because:
- Some RAMdrive creators were not available for download anymore (EsperanceDV).
- Other scripts did not provide a way to store the cache to disk at logout.
Therefore, I created this Mac OSX application (which is actually a simple Bash script), which you can place in your login items which will create a RAM drive and store/restore Safari cache on login/logout.
To get it running:
- Install an up to date version of rsync, with Mac OS X and HFS+ enhancements for rsync.
- Download and unzip my app from the above link.
- In Finder do a 'Show Package Contents' of the just downloaded app and edit the file: Contents/MacOS/cache2RAM.sh
- Edit the lines below #Settings to your wishes (or anything else you want to change). You can change RAM disk size, name and the backup directory path here.
- Save the file and drag the Cache2RAM.app bundle to your login items (System Preferences » Accounts.
- Logout and login again.
Open Terminal and type:
rm -rf ~/Library/Caches/com.apple.Safari; ln -s /Volumes/RAMDisk/[username]/SafariCache ~/Library/Caches/com.apple.Safari
[crarko adds: I haven't tested this one. I've mirrored the application here.
I made some corrections based on the comments.]

