i made a file to print out the image file with W and H i define by get method
but my problem is to cache this pictures
i add this headers to the file
@header("Cache-Control: private, max-age=10800, pre-check=10800");
@header("Pragma: private");
@header("Expires: " . date(DATE_RFC822,filemtime($full_path)));
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])
&&
(strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == filemtime($full_path))) {
// send the last mod time of the file back
header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($full_path)).' GMT',true, 304);
exit;
}else
{
@header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($full_path)) . ' GMT');
@header('Content-Type: image/jpeg');
@imagejpeg($image);
}
but my problem is some pictures are cached ok , but others are not , and sometime pictures inside album not appear until if i disable the cache header
is my headers are correct ? , and about the cache do i have to use – or + to set the time cache how its work ?
because they use Htaccess with mod_expires?
Example #1:
Read This Documentation
Example #2: