PHP Dosyanızın başına bu kodu
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
ob_start("ob_gzhandler");
} else {
ob_start();
}
function compress_output($buffer) {
$search = array(
'/\>[^\S ]+/s',
'/[^\S ]+\</s',
'/(\s)+/s',
'/<!--(.*?)-->/s'
);
$replace = array('>', '<', '\\1', '');
return preg_replace($search, $replace, $buffer);
}
ob_start("compress_output");
?>en son satıra da <?php ob_end_flush(); ?>Bu kodu koyduğunuz zaman hiç bir bozulma yaşamadan kodlarınız tamamen optimize edilir ve %30 oranında boyuttan avantajınız olur.
Gereksiz eklentilere ihtiyaç duymayın ve kullanmayın.
WordPress functions.php dosyanıza da entegre edebilirsiniz.