關於wordpress後台首頁載入ajax.googleapis特別慢的解決辦法

來源:互聯網
上載者:User

標籤:http   color   一點   修改   訪問   字串   測試   1.0   https   

通過審查元素髮現,拖慢後台載入速度的主要是兩個路徑

1.https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js

2.http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/smoothness/jquery-ui.css

都是Google的,現在國內訪問Google幾乎是訪問不了,必須要FQ才可以,下面是解決這兩東西的辦法

第一種:

  通過wordpress後台安裝 ‘Disable Google Fonts’ 這個外掛程式,這是最簡單的解決辦法,網上大多都是用的這個,不過我測試了一下,沒有效果,沒起效果的接著往下看!

第二種:

  1.首先解決prototype.js,找到wp-includes下面的script-loader.php,尋找字串 ‘prototype’ 

$scripts->add( ‘prototype‘, ‘http://cdn.bootcss.com/prototype/1.7.3/prototype.min.js‘, array(), ‘1.7.3‘);

我們換成bootstrap的cdn加速代碼

  2.解決jquery-ui.css,找到wp-includes下面的functions.php檔案,在最下面添加如下代碼,思路就是替換

function hc_cdn_callback($buffer) {    return str_replace(‘ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/smoothness/jquery-ui.css‘, ‘cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.min.css‘, $buffer);//主要是修改這行}function hc_buffer_start() {    ob_start("hc_cdn_callback");}function izt_buffer_end() {    ob_end_flush();}add_action(‘init‘, ‘hc_buffer_start‘);add_action(‘shutdown‘, ‘hc_buffer_end‘);

查看你的具體字串格式,可能需要進行修改一點內容!

有更好的方法還請分享一下,如有錯誤還請指出,謝謝!

 

關於wordpress後台首頁載入ajax.googleapis特別慢的解決辦法

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.