views:

1271

answers:

5

I'm developing an HTML newsletter system using PHP & PEAR. It sends out the emails fine.

However I cannot force Apple Mail to reload images from the server. I have tried:

  • Restarting Mail
  • Clear ~/Library/MailDownloads
  • Clear ~/Library/Cache/Mail
  • Empty Safari cache

Does any one know where Apple Mail caches the images ?

William

+2  A: 

You could use OnyX to clear all apps cache and also tune up other aspects of the OS.

Leandro Ardissone
to me this seems like using a sledge hammer to open a nut. (Onyx is a fine program, but not really the answer.)
William Macdonald
+1  A: 

Is adding a dummy query string to all image URLs an option for you?

<img src="http://example.com/images/hello.png?343882881923"/&gt;

You'd simply update the query string to prevent the cached image from being used.

Ates Goral
yes that is possible, but surely I can 'empty the cache' or 'force a reload'. Your suggestion is a valid word-around, but not an answer.When I get a chance I will try using fseventer to find where the files are stored.
William Macdonald
A: 

Hi William,
I spent some time playing with this today and was able to duplicate the problem easily. The image in mail doesn't change - whichever picture shows when you first look at the email seems to stay with that message no matter how many times you change the image on the server. Even when I forward the message to myself it doesn't reload the picture. Wow. And I couldn't find the images anywhere in any cache, either.

I did find a reference from last summer to this same problem with no real answer. One person agreed with Leandro Ardissone's answer and recommends using OnyX to "trash the Application Cache", but it's only a one time fix.

The "dummy query string" suggested by Ates Goral worked great for me, so if you can deal with changing that every time you change the picture that seems to be your best bet.

Wish I could be more help, but I'm stumped.

I think we need someone from the Apple Mail group to enlighten us to a real fix!

notruthless
Hi, when I get a chance I will use fseventer to see what is happening in the background.
William Macdonald
+1  A: 

Using the latest FSeventer program I traced the cache file to:

/private/var/folders/Sl/rand chars+++TM/-Caches-/com.apple.mail/Cache.db

I tried turning of internet connection, deleting the file, and then viewing the HTML newsletters. No images loaded. After re-connecting and viewing the HTML mail the Cache.db file grew to 1MB in size.

There seems to be another intermediary cache. I tried deleting the cache & disconnectinf whilst viewing two different newsletters. They bothy displayed properly. After I quit and re-opened Mail, they images did not display.

So it is possible to delete the cache, but I have not found a way to force refresh the images.

William Macdonald
A: 

I just encountered this problem, and was able to solve it by quitting Mail and deleting:

~/Library/Caches/com.apple.mail/Cache.db

gz76