How can i add expires header to images?
i used the following in css file and php respectively
<?php
-----------CSS------------------------------------------------------
ob_start ("ob_gzhandler");
header ("content-type: text/css; charset: UTF-8");
header ("cache-control: must-revalidate");
$offset = 48 * 60 * 60;
$expire = "expires: " . gmdate ("D, d M Y H:i:s", time() + $offset) . " GMT";
header ($expire);
?>
----------PHP------------------------------------------------------
<?php
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))
ob_start("ob_gzhandler");
else
ob_start();
header ("content-type: text/html; charset: UTF-8");
header ("cache-control: must-revalidate");
echo $offset = 48 * 60 * 60;
$expire = "expires: " . gmdate ("D, d M Y H:i:s", time() + $offset) . " GMT";
header ($expire);
?>
Both are working but it does not applies to the images used in css files. They need to be specified separately.
How?
This is my problem can any one help me please...
Also if u can please tell me how to specify Etags?
I also tried in another method using .htaccess
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/png A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType image/x-icon A2592000
</IfModule>
i think this is working but not working for icon files
i also don know what this means "A2592000"
how can i set my own time for as expire header?
Thanks in adavance.