Odd Cacheing Issue with MarsEdit and WordPress

MarsEditIcon128.jpg

I noticed today that my image of the Firefox app icon had a black pixel on the lower-righthand corner of the image. I pulled up Acorn and fixed it, and moved it to HostMonster, and it looks fine if I hit it directly from a web browser. I also copied it but in MarsEdit and removed the old thumbnail image to let MarsEdit re-create it, and still... in MarsEdit's Preview Pane, the old image remains. I'm stumped.

So I posted a message to the MarsEdit online forums and got this reply back from Daniel:

Hi Dr Bob - try deleting the MarsEdit cache folder that is creating by WebKit:

[Home] -> Library -> Caches -> com.red-sweater.marsedit

I'm not sure why some items are cached so aggressively even when they've changed.

So I tried that... still the old image remains. In fact, after stopping/starting MarsEdit a few times the directory is never created. This tells me that this is not only not the place the image is being held, it's not even used for what the author expected.

I'm at a bit of a loss to understand where the old image is being held. It's not on the web server, it's not in the cache I just deleted, it's not in the MarsEdit application support data... I'm stumped. And yet I'm sure it's still there. I can see it. Every Firefox post has this image and it's that way in the preview pane of all of them.

Bugger. I'm going to have to see if I can force MarsEdit to reload things. Or I'm going to have to find out where the image cache is really located and wipe that image out.

[1:15 pm] UPDATE: I've cleared the Safari cache, I've verified that the images on the web site are the correct ones, so it's a simple matter of my laptop thinking that the file hasn't changed, and therefore, not to reload it for MarsEdit. I've updated the post on the support forum to say what I've tried and what hasn't worked, and I guess I'm going to have to wait for another idea. Googling 'image cacheing WebKit "Mac OS X"' gives me nothing of real relevance, and too much noise. So I'm going to have to live with it until it thinks the image needs to be replaced.

[2:00 pm] UPDATE: Daniel suggested looking for a 'MarsEdit' directory in ~/Library/Caches/ and deleting that. There was one there as well - with lots of stuff in it, but removing it didn't effect a thing. Also, it was not recreated after several start/stop cycles. Very odd. I've updated the thread on the forum and we'll see what he comes back with.

[2:30 pm] UPDATE: I've removed the old Ranchero MarsEdit defaults, and while I didn't think they were doing anything, I didn't want to take the chance. Also, the icon database in ~/Library/Icons/WebpageIcons.db didn't hold the key either. I removed that, restarted MarsEdit, and still no difference. Wherever these images are, they are pretty well hidden. I looked at the defaults for the app and say nothing that would point to a different directory. It's a real stumper, I'd say. I think I'm giving up for now. I'm just running out of ideas.

[4:30 pm] UPDATE: it turned out that if I reloaded the page in the Preview pane, the same bad image came back. But if I reloaded it again then on the second reload, the right image was there. So, lesson learned - reload a few times to make sure you get the very latest.

[6/26 3:43am] UPDATE: it turns out from this article that in 10.5.2 Apple changed the location of the WebKit cache from ~/Library/Caches to /var/folders - not for any reason of security but simply performance - the home directory could be on a network drive but /var is on the machine itself. So, to clear the cache, you have to clear out /var/folders. Unfortunately, it's not easy to find the cache entries, and you have to really search (ala find) to find the ones you're looking for. FOr this case, it's:

  pushd /var/folders
  find . -name \*marsedit\*

and you'll find the directory you're looking for. Delete that, and the cache is gone.