View Safari cache files while offline

Oct 28, '03 09:11:00AM

Contributed by: MattHaffner

I was using my PowerBook on the bus the other morning and was desperate to view a page I had looked at a few days prior in Safari. Since I had rebooted the night before, it was not on the previous page arrow pulldown menu. Safari's great History apparently only remembers the URL and not the link to cache files, which is a real shame, since this would be great for occasional off-line viewing without having to remember to grab the page before you go off-line.

So, I went delving into Safari cache files (~/Library -> Cache -> Safari) to find the page I wanted. Fortunately, using grep from the command line (or the Finder's search -- but remember that the Finder's search is not case sensitive), it's easy to find a cache file with some content that corresponds to the page you want to display. But unfortunately, the file is of type .cache, and not just the original .html file. The HTML is contained in the cache file, however.

Safari won't open these files from it's File -> Open menu, but to my surprise, it did display them with a drag and drop from the Finder! There is header and footer garbage displayed from the remaining contents of the .cache file, but for the few cases I tried, Safari found the HTML and rendered the page well enough for me to get what I needed off of it.

I know there are a lot of cache emptiers out there, but are there any Cache viewing apps or a utility to strip the HTML out of the cache files to make the viewing even nicer?

Comments (6)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20031021123427554