What sort of header do I need to send for the download of an image (in the file_download hook implementation) if I want the image to be always cachable in the browser...?
I have tried many things, and always the image is reloaded.
I use a HTTP request spy and see this :
http://11heavens.com/system/files/inspire/thumbnail/node1174879712_image...
GET /system/files/..... image83.jpg HTTP/1.1
Host: 11heavens.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Accept: image/png,*/*;q=0.5
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://11heavens.com/
Cookie: PHPSESSID=....
If-Modified-Since: Mon, 26 Mar 2007 04:32:52 GMT
HTTP/1.x 200 OK
Date: Mon, 26 Mar 2007 04:33:08 GMT
Server: Apache...
X-Powered-By: PHP/...
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Cache-Control: post-check=0, pre-check=0, public
Pragma: no-cache
Last-Modified: Mon, 26 Mar 2007 04:33:08 GMT
Content-Length: 38122
Keep-Alive: timeout=15, max=97
Connection: Keep-Alive
Content-Type: image/jpeg; name=....image83.jpg
My code is :
<?php
...
return array(
'Content-Type: '. $type .'; name='. $name,
'Content-Length: '. $size,
'Cache-Control: public',
);