我在http://tools.pingdom.com/
中試圖讓我客戶的網站性能得分高於80。我已經安裝了GZIP壓縮,Lazyload,可溼性粉劑超高速緩存,並動了我的JS腳本到頁腳:提高wordpress性能的最佳方法是什麼?
#------------------------------------------------------------------------#
// Begin Custom Scripting to Move JavaScript from the Head to the Footer
function remove_head_scripts() {
remove_action('wp_head', 'wp_print_scripts');
remove_action('wp_head', 'wp_print_head_scripts', 9);
remove_action('wp_head', 'wp_enqueue_scripts', 1);
add_action('wp_footer', 'wp_print_scripts', 5);
add_action('wp_footer', 'wp_enqueue_scripts', 5);
add_action('wp_footer', 'wp_print_head_scripts', 5);
}
add_action('wp_enqueue_scripts', 'remove_head_scripts');
// END Custom Scripting to Move JavaScript
我還沒有77%以上的得分。由於很多圖像都是通過管理員添加的,所以我無法控制它們的大小。另一個令人沮喪的事情是CSS文件和主題是如何單獨保存和解壓縮的。由於不同的位置和優先級,我不得不手動縮減每個css文件。不幸的是,我無法分享我的網站的URL,但是如果有什麼我可以做的,以提高速度?
嗨我不知道我理解圖像的答案。我安裝了WP Total Cache,但在設置頁面中找不到任何縮小工具。另外,就添加圖像大小而言,這適用於哪些圖像?通過管理部分或網站目前的設置添加的東西? – HGB