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 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.

  1. Close all Safari tabs and windows. Don’t exit Safari, just close all its windows.
  2. Empty Safari’s cache: Safari menu -> Empty cache
  3. Exit Safari.
  4. Open Terminal*: Applications -> Terminal or Spotlight -> “Terminal”
  5. 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)
  6. 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.
  7. 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.

Comments off

Manually uninstalling Adobe Acrobat Reader 9 on Mac OS X Leopard

Adobe Acrobat Reader doesn’t provide an uninstall utility on Mac OS X (despite claiming to do so on their support site) and after installing it for a single test, I wanted it gone. Following are the steps I took to remove Adobe Acrobat Reader from my MacBook Pro running Mac OS X Leopard (10.5.7).

Note that these instructions will likely remove all Adobe software, including AIR if you have that installed; AIR is installed automatically (and without telling you) with Acrobat Reader.

Delete these folders from Finder:

  • /Applications/Adobe Acrobat
  • /Applications/Utilities/Adobe Utilities

In Terminal, type sudo find / -name *Adobe*
From that list, delete these:

  • /Library/Application Support/Adobe
  • /Library/Internet Plug-Ins/AdobePDFViewer.plugin
  • /Users/(your user account)/Library/Application Support/Adobe
  • /Users/(your user account)/Library/Application Support/Adobe/Acrobat
  • /Users/(your user account)/Library/Caches/Adobe
  • /Users/(your user account)/Library/Logs/Adobe
  • /Users/Shared/Library/Application Support/Adobe

In Terminal, type sudo find / -name *Acrobat*
From that list, delete:

  • /Users/(your user account)/Library/Caches/Acrobat

Reboot. I don’t like having to, but several of the Adobe components were locked or in use and I couldn’t completely delete them. After rebooting, a sample PDF linked from a Web site opened in Safari via Preview, and a downloaded PDF opened in Preview standalone just like they used to.

Right now it looks like I got everything, but I’ll update this post if I find any more remnants.

Comments (3)

Confessions of a Switcher

This is part 1 of a theoretically infinite series.

As noted last week, upon the sad, premature soup-induced demise of my four-year-old Dell Inspiron 600m, I purchased a new 15″ MacBook Pro. I justified this to myself by noting that the MacBook Pro has been called the “best Windows notebook“, but, and here’s the first confession, after setting up Boot Camp and installing Windows XP on the first day… I haven’t touched Windows on the machine since. It’s been all OS X all the time. And I haven’t had to reboot once.

To be fair, there are still a couple of Windows applications for which I’m looking for alternatives: Picasa, Paint.NET, ActiveSync (to sync my Windows Mobile phone, which I will not be replacing with an iPhone). I know about iPhoto for the first and Missing Sync for the last; I plan to copy some of my very large photo library over and let iPhoto convince me, but I’m turned off by the nearly $40 price tag for Missing Sync. Meanwhile, I’ve set up Bluetooth file transfer between the Mac and the phone — something that never worked on the Dell — and have managed to do backups of a sort for the time being.

I really don’t know where to begin for a good Mac OS alternative to Paint.NET. OS X doesn’t appear to come with an image editor and I don’t need anything as complex as Photoshop or the GIMP. Suggestions welcome!

As a longtime, dedicated Opera fan and user I’m rather surprised at how quickly I’ve taken to Safari. I had the Windows version of Safari on the Dell as a backup and testing browser, so I was familiar with it, and I do have the Mac OS version of Opera on the Mac but it’s sitting, forlorn, unused in the Dock. I found a HOWTO on getting iChat to work with Yahoo (it already works with AIM and other Jabber services); I’ve set up Mail with my email accounts and RSS feeds; I’ve imported most of my music into iTunes; I’ve recorded three podcast segments in GarageBand so far.

To use an over-used cliche, everything — or at least almost everything — just works. Want to wake up the machine? Open the lid, it wakes up. It doesn’t click and buzz and hum and whir for a while before deciding whether this will be one of the approximately 25% of times when, like the Dell, it will refuse to wake up. It connects to WiFi almost instantly. Bluetooth, mentioned above, works the way it should; in fact, I’ve been able to pair a set of Bluetooth headphones I bought to use with the phone to the Mac, and that never worked on the Dell (or even my company laptop, a Lenovo ThinkPad).

Things work the way I instinctively think they ought to work.

The point here is that I’m really quite happy with the Mac and, contrary to my expectations, I’m having very little trouble in learning to be comfortable with OS X.

Edit to add: I think I have my first downline. I’ve been bringing the Mac to work (I always brought the Dell to work) and a couple of the other engineers have been admiring it. One in particular just spent ten minutes asking me very specific questions about “how to do stuff” on the Mac, Web browsing, email, the usual. He seemed interested.

Comments off