打开wordpress后台,发现很卡,通过开发者工具看到是因为加载http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css这个元素导致的。

<link rel='stylesheet' id='jquery-ui-smoothness-css'  href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css' type='text/css' media='all' />

 

解决方案:

functions.php里面添加如下代码:

function hc_cdn_callback($buffer) {
    return str_replace('googleapis.com', 'useso.com', $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');

 

 

相关文章:

  • 2022-02-01
  • 2021-10-12
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
猜你喜欢
  • 2021-11-26
  • 2022-12-23
  • 2021-10-01
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案