January 20, 2010

With Features like These...

Are you aware that Safari 4.* saves two snapshots (a png and a jpeg file) of each web page you visit, as well as some seemingly random ones from your history or bookmarks? I wasn't, till I accidentally stumbled on it yesterday.

The culprit is an executable file called Safari Webpage Preview Fetcher in the Safari package. Its only function that I can see is in aid of the Top Sites feature of this release of Safari, a cool-looking but more or less useless routine that displays sites in a table, and illustrates the browsing history with images. I haven't found an easy way to turn only it off, though "Private Browsing" does knock it out along with everything else it knocks out. There's also an option to "stop loading previews" when you're in Top Sites, but that doesn't prevent the images from being generated and saved when you visit sites. The "Reset Safari" dialog box has a checkbox to clear the files that are already accumulated, but it doesn't stop new ones being generated. It's less hassle to remove them manually, but it is still a hassle.

These files can take up a great deal of space if this thing is left running over time. My folder of previews was over 2.5 GB on a machine I've had for two months; and only a few minutes of routine browsing can quickly accumulate hundreds of these files. It is also a potentially awful security risk if you use webmail, especially since, as I assume, most people who are using it have no idea that it's there. Counter-intuitively, clearing your history and/or cache has no effect on it, even though the directory in which the images are saved resides in Library/Caches.

Anyhow, I thought people might like to know.

UPDATE: In the comments, Sigivald points out this Apple Support discussions thread with a few work-around type solutions. The easiest one is simply to empty and then lock the $HOME/Library/Caches/com.apple.Safari/Webpage Preview folder manually in the Finder. That doesn't turn off the Web Page Preview Fetcher, but it prevents it from writing anything to that directory. It will still try to, though, which is a waste and which will generate an error for every single webpage you load. But it's not as much of a waste as constantly writing thousands of big, useless files in the background.

Another solution mentioned is to enter the command in the shell:

defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
This is supposed to shut the whole thing down. I haven't tried it, so I can't verify that it works. If it's valid, I would guess the way to reverse this simply to delete it (i.e. "defaults delete com.apple.Safari DebugSnapshotsUpdatePolicy") but I'm not sure. I'd be careful about editing defaults you don't know how to reverse, because that kind of thing can cause havoc when future updates are applied.

As some commenters point out, even just locking a folder in the library can have "side effects," but it's easy to uncheck the box. It's not ideal, but until they write a way to toggle it in the preferences into the program, the locked folder approach seems like the way to go.

Posted by Dr. Frank at January 20, 2010 08:25 PM | TrackBack

that's ridiculous!

Posted by: aaron at January 20, 2010 08:46 PM

So they really are watching...

Posted by: Leah at January 20, 2010 09:47 PM

Snow Leopard was so terrible and pissed me off so much that I installed Windows 7 on my Mac. Sacreligious I know, but my other option was to go back to Tiger and support has been dropped on that so no new software for Tiger. Bah!

Posted by: Zaphod at February 5, 2010 06:55 PM
Post a comment

Remember personal info?