title: PHP imagejpeg - MIME type in Safari on refresh
body: <p>I have written a php script that generates a captcha image and gets called from my web form:</p>
  
  <pre><code>&lt;img src="captcha.php?key=12345"&gt;&lt;/img&gt;
  </code></pre>
  
  <p>The php script (the relevant part) looks like this.  $image was correctly created earlier:</p>
  
  <pre><code>header('Content-Type: image/jpeg');
  header('Cache-Control: no-cache');
  header('Pragma: no-cache');
  imagejpeg($image);
  imagedestroy($image);
  </code></pre>
  
  <p>This works correctly in Firefox, but not in Safari.  Well, most of the time...  Sometimes (usually on the first load) safari works fine, but if I refresh the page, I get the following error in web inspector: <strong>Resource interpreted as image but transferred with MIME type text/php.</strong>  Is this an apache setup issue or something in my code?  Any suggestions on how to solve this would be greatly appreciated.</p>
  
  <p>Here are the request and response headers:  </p>
  
  <p>Request:</p>
  
  <pre><code>Cache-Control:max-age=0
  Referer:http://www.fpcsd.org/invite.php
  User-Agent:Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us)
  AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1
  </code></pre>
  
  <p>Response:</p>
  
  <pre><code>Cache-Control:max-age=604800
  Connection:keep-alive
  Date:Mon, 06 Jun 2011 16:45:41 GMT
  Expires:Mon, 13 Jun 2011 16:45:41 GMT
  Server:nginx/0.7.65
  X-Powered-By:PHP/5.3.3
  </code></pre>