الطريقة
افتح قالب الهيدر
في اوله ضع الكود
كود:
$data = implode("", file("bigfile.php"));
$gzdata = gzencode($data, 9);
$fp = fopen("bigfile.php.gz", "w");
fwrite($fp, $gzdata);
fclose($fp);
?>
foreach (glob("*.php") as $filename) {
echo "$filename size " . filesize($filename) . "\n";
}
?>
ob_start( 'ob_gzhandler' );
?>
$compressed = gzdeflate('Compress me', 9);
$uncompressed = gzinflate($compressed);
echo $uncompressed;
?>
2- يرفع الى من خلال FTP داخل ملف .htaccess بمجلد www
نضع هذا الكود في اخره
كود:
RewriteEngine On
ExpiresActive On
ExpiresByType image/gif "access 1 week"
ExpiresByType image/jpg "access 1 week"
ExpiresByType image/jpeg "access 1 week"
ExpiresByType image/png "access 1 week"
ExpiresByType text/css "access 1 week"
ExpiresByType text/js "access 1 week"
ExpiresByType application/x-shockwave-flash "access 1 week"
ExpiresByType application/x-javascript"access 1 week"
افتح قالب الهيدر
في اوله ضع الكود
كود:
$data = implode("", file("bigfile.php"));
$gzdata = gzencode($data, 9);
$fp = fopen("bigfile.php.gz", "w");
fwrite($fp, $gzdata);
fclose($fp);
?>
foreach (glob("*.php") as $filename) {
echo "$filename size " . filesize($filename) . "\n";
}
?>
ob_start( 'ob_gzhandler' );
?>
$compressed = gzdeflate('Compress me', 9);
$uncompressed = gzinflate($compressed);
echo $uncompressed;
?>
2- يرفع الى من خلال FTP داخل ملف .htaccess بمجلد www
نضع هذا الكود في اخره
كود:
RewriteEngine On
ExpiresActive On
ExpiresByType image/gif "access 1 week"
ExpiresByType image/jpg "access 1 week"
ExpiresByType image/jpeg "access 1 week"
ExpiresByType image/png "access 1 week"
ExpiresByType text/css "access 1 week"
ExpiresByType text/js "access 1 week"
ExpiresByType application/x-shockwave-flash "access 1 week"
ExpiresByType application/x-javascript"access 1 week"