Could find a solution from another post :
You need to add the Etag header in the header response like this :
header(‘Content-type: image/png’);
ob_start();
imagepng($map);
$image = ob_get_clean();
$etag = md5($image);
header(‘Last-Modified: ‘.gmdate(‘D, d M Y H:i:s’).’ GMT’);
header('Etag: '.$etag);
imagepng($map);