0

I have seen an error which seems extremely weird to me.

http://www.shrimadrajchandramission.org/grace/downloads/wallpapers/images/download.php?wp=SRM-Wallpaper-36-highres.jpg

On my browser, the above link shows 8.4 MB download file size

http://www.shrimadrajchandramission.org/grace/downloads/wallpapers/images/download.php?wp=SRM-Wallpaper-36-highres.jpg&

While this one shows 15.3 MB download file size.

I want to understand if the Server itself caches in some manner, because I had my Hard Disk Replaced recently so I have installed browsers on fresh OS, but it still shows the old filesize (and when you download it, half of it is corrupt-gray color).

download.php on the server has these Headers set:

header('Expires: 0');   
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Last-Modified: '.gmdate ('D, d M Y H:i:s', filemtime ($file_name)).' GMT');
header('Cache-Control: private',false);
header('Content-Type: image/jpg');
header('Content-Disposition: attachment; filename="'.basename($file_name).'"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: '.filesize($file_name));

I am now using a JavaScript Date Function to get the file afresh from the server. So my current issue is resolved, but I am trying to understand what is happening behind the scene.

If you are unable to reproduce this issue, then what could be the issue on my computer specifically? I have at least one person whom I know facing the same scenario.

Thanks!

Nirav Zaveri
  • 687
  • 1
  • 9
  • 28
  • I am getting the exact same 16081803 byte (16.1MB) image on both supplied links. The caching isn't being done on the server. It's either your browser or an intermediate proxy. – Orangepill Aug 15 '13 at 16:25
  • Now 16.1 MB is again a different figure! Does the image download completely? – Nirav Zaveri Aug 15 '13 at 16:36
  • yep... 6400x8000 jpeg image. – Orangepill Aug 15 '13 at 16:44
  • I don't use any proxies, and as I stated, all the browsers are new as the Hard Disk is new. So is there anything else that could be causing the issues? – Nirav Zaveri Aug 15 '13 at 16:52
  • I would remove the false from `header('Cache-Control: private',false);`. Your network may be caching the image for you (pretty common on celluar networks). This would also account for the difference in file size as celluar networks also attempt to optimize images so they are smaller going over the air. Cache-Control private should disable any network level caching. – Orangepill Aug 15 '13 at 17:00

0 Answers0