Welcome Guest, Not a member yet? Register   Sign In
how to image caching?
#1

[eluser]melpuggi[/eluser]
hello,

i use dynamic pages like "images/1.jpg" for displaying images.

i want to cache images for browsers

look my headers

Code:
$expires_gmt = gmdate("D, d M Y H:i:s", time() + (60 * 60 * 24 * 3) )." GMT";
$modified_gmt = gmdate("D, d M Y H:i:s", time() + (3600 * -1 * 24 * 365) )." GMT";
$mime = "jpeg"; // gif or png
header("Pragma : public");
header("Expires: $expires_gmt");
header("Last-Modified: $modified_gmt");
header("Cache-Control: private, max-age=".(60 * 60 * 24 * 3)."");
header("Content-Length: $result->image_link_size" );
header("Content-Type: image/$mime" );

but firefox does not cache my images and display pages in 4 or 5 second.

ie cache them and display pages in 1 or 2 second.

what is my problem?


Messages In This Thread
how to image caching? - by El Forum - 01-22-2009, 01:04 PM
how to image caching? - by El Forum - 01-22-2009, 02:45 PM
how to image caching? - by El Forum - 02-04-2009, 05:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB