Speeding up Safari (Mac) by turning off its cache
WARNING: This procedure worked for me but I do not guarantee it will work for everyone. Use at your own risk. I primarily use Apple’s Safari browser, along with Google Chrome and Opera. Chrome is almost to the point where I might be willing to switch, but right now I’m very comfortable with Safari. With [...]
WARNING: This procedure worked for me but I do not guarantee it will work for everyone. Use at your own risk.
I primarily use Apple’s Safari browser, along with Google Chrome and Opera. Chrome is almost to the point where I might be willing to switch, but right now I’m very comfortable with Safari. With one major exception: after an hour or two of heavy use (multiple tabs and windows, reloading pages, lots of script-heavy pages) the browser’s performance drops to a level that is just unacceptable, especially on a 2.4GHz Core 2 Duo MacBook Pro with 4GB RAM. Page loads are sluggish and almost every click on a page results in a beachball for a few seconds. After a bit of Googling and experimenting I narrowed the problem to the browser cache. It seems that Safari’s mechanism for searching its cache is, let’s say, suboptimal.
Unlike most other browsers, Safari provides no user-accessible preference for adjusting or disabling its cache. So I looked deeper.
- Close all Safari tabs and windows. Don’t exit Safari, just close all its windows.
- Empty Safari’s cache: Safari menu -> Empty cache
- Exit Safari.
- Open Terminal*: Applications -> Terminal or Spotlight -> “Terminal”
- In the Terminal window, type:
chmod a-w Library/Caches/com.apple.Safari/Cache.db
(the above should be all one line; hit Return or Enter at the end of the line) - Type:
ls -al Library/Caches/com.apple.Safari/Cache.db
(the above should be all one line; hit Return or Enter at the end of the line)
You should see:-r--r--r-- 1 [your user name] staff 26624 Sep 28 17:33 Library/Caches/com.apple.Safari/Cache.db
The details will differ, but the important part is-r--r--r--which is Unix for “read-only for everyone”. That means Safari can’t write to its cache file, effectively turning it off. - Relaunch Safari and browse normally. If your results are like mine, you’ll note that the sluggish performance of Safari after an hour or two of heavy use is now just gone.
*Just re-emphasizing the warning at the top of this post. If you follow these instructions exactly, nothing untoward should happen. However, Terminal is the window into the deepest, darkest inner workings of Mac OS X. It’s possible to really screw things up with a simple typo. If you have any doubt, don’t do it.
Permalink Comments off


