ismartcom005
MasterSergeant
nghe đồn là thêm đoạn này vào header
PHP:
<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>
không được thím ơi, em thêm rồinghe đồn là thêm đoạn này vào header
PHP:<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>
ismartcom005
MasterSergeant
check ?
Nếu compression của Google PageSpeed thì bật minify js lên
Nếu compression của Google PageSpeed thì bật minify js lên
minify js ở chỗ nào thế?
ismartcom005
MasterSergeant
lấy hết js ra vào mấy trang jscompress =))
đờ phắc đùa nhau à =)). Hỏi thật mà, không thấy minify js, chỉ thấy minify css thôi :3lấy hết js ra vào mấy trang jscompress =))
ismartcom005
MasterSergeant
thật ấy chứ, lúc trước thấy có cái XFOptimise =))đờ phắc đùa nhau à =)). Hỏi thật mà, không thấy minify js, chỉ thấy minify css thôi :3
ko thì tạo 1 file php gzip-js.php nội dung vầy
PHP:
<!--?php
// initialize ob_gzhandler function to send and compress data
ob_start ("ob_gzhandler");
// send the requisite header information and character set
header ("content-type: text/javascript; charset: UTF-8");
// check cached credentials and reprocess accordingly
header ("cache-control: must-revalidate");
// set variable for duration of cached content
$offset = 60 * 60;
// set variable specifying format of expiration header
$expire = "expires: " . gmdate ("D, d M Y H:i:s", time() + $offset) . " GMT";
// send cache expiration header to the client broswer
header ($expire);
?-->
xong nhét cái này vào htaccess
HTML:
<filesmatch "\.(js)"="">
ForceType application/x-httpd-php
php_value auto_prepend_file "/the/full/path/of/this/file/gzip-js.php"
</filesmatch>
Hướng dẫn sử dụng
| XenForo 1 | XenForo 2 |
| Translate by PVS | |
| Xenforo là gì? | |
| Xây dựng MXH bằng Xenforo | |



