Wordpress 自定义主题在页面重新加载时有 mod-pagespeed 没有延迟 404 错误

Wordpress Custom Theme has mod-pagespeed no defer 404 error on page reload

问题: 在重新加载 Wordpress 4.1 自定义主题的页面时,我在控制台中收到错误 "GET ... /%3Cscript%20pagespeed_no_defer= 404 (Not Found)",并且在网页上显示脚本。如果我再刷新几次,它就会消失,然后再刷新一次,它就会 returns.

目标/问题: 关于如何进一步解决此错误的指导?这就像仅禁用此功能一样简单吗?最重要的是,我想了解为什么会出现此问题。感谢您的宝贵时间!

解决方法: 如果我在 httpd.conf 中禁用 pagespeed,问题就会消失。

环境: 客户端:OS X 10.10.2,Chrome 40.0.2214.94(64 位),Safari 8.0.3,FF 35.0 .1;服务器:Bitnami VM,Ubuntu 14.04,Wordpress 4.1

背景: 我正在创建一个基本的 Wordpress 主题。我从 underscores.me/ 中的模板开始,并添加了一些通用的 .js(bootstrap,等等...)当我第一次加载页面时,它看起来不错。当我点击刷新时,它把 js 代码扔进了正文。我是使用 PageSpeed 的新手,所以任何指导将不胜感激。我开发了其他主题和插件,但这对我来说是个新问题。

参考链接:
https://forums.plex.tv/index.php/topic/98618-script-appears-in-reply-as-text-when-doing-quote-reply-on-forum/ 最符合我所看到的,以及我使用的解决方法...

https://developers.google.com/speed/pagespeed/service/DeferJavaScript 如果答案在这里,我没看到...

我还有更多链接,但这些是最相关的。

这是页面正确加载时的示例...

<html lang="en-US">    <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="http://192.168.70.130/xmlrpc.php">

<title>NV | NVWPDEVSPM03    </title>
<link rel="alternate" type="application/rss+xml" title="NV » Feed" href="http://192.168.70.130/feed/">
<link rel="alternate" type="application/rss+xml" title="NV » Comments Feed" href="http://192.168.70.130/comments/feed/">
<link rel="alternate" type="application/rss+xml" title="NV » Home Comments Feed" href="http://192.168.70.130/home/feed/">
<link rel="stylesheet" id="open-sans-css" href="//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&amp;subset=latin%2Clatin-ext&amp;ver=4.1" type="text/css" media="all">
<link rel="stylesheet" id="dashicons-css" href="http://192.168.70.130/wp-includes/css/dashicons.min.css,qver=4.1.pagespeed.ce.UZxcrXP6ne.css" type="text/css" media="all">
<link rel="stylesheet" id="admin-bar-css" href="http://192.168.70.130/wp-includes/css/admin-bar.min.css,qver=4.1.pagespeed.ce.ijxCXNyHcG.css" type="text/css" media="all">
<link rel="stylesheet" id="nvapp2015-style-css" href="http://192.168.70.130/wp-content/themes/nvapp2015_s/A.style.css,qver=4.1.pagespeed.cf.bZbMpNtUMT.css" type="text/css" media="all">
<link rel="stylesheet" id="nvapp2015-bootstrap-min-style-css" href="http://192.168.70.130/wp-content/themes/nvapp2015_s/css/A.bootstrap.min.css,qver=4.1.pagespeed.cf.XAf2gFe0Gs.css" type="text/css" media="all">
<link rel="stylesheet" id="nvapp2015-font-awesome-min-style-css" href="http://192.168.70.130/wp-content/themes/nvapp2015_s/css/A.font-awesome.min.css,qver=4.1.pagespeed.cf.HpcIsdYD5q.css" type="text/css" media="all">
<link rel="stylesheet" id="nvapp2015-jquery-ui-min-style-css" href="http://192.168.70.130/wp-content/themes/nvapp2015_s/css/A.jquery-ui.min.css,qver=4.1.pagespeed.cf.L5sry_GBdl.css" type="text/css" media="all">
<link rel="stylesheet" id="nvapp2015-google-roboto-css" href="http://fonts.googleapis.com/css?family=Roboto%3A400%2C300%2C300italic%2C400italic%2C500%2C500italic%2C700%2C700italic&amp;ver=4.1" type="text/css" media="all">
<link rel="stylesheet" id="nvapp2015-user-style-css" href="http://192.168.70.130/wp-content/themes/nvapp2015_s/css/A.nvapp2015-user.css,qver=4.1.pagespeed.cf.fmlN9vVCt3.css" type="text/css" media="all">
<script type="text/javascript" src="http://192.168.70.130/wp-includes/js/jquery/jquery.js,qver=1.11.1.pagespeed.jm.z9hb-Gxqf6.js">    </script>
<script src="http://192.168.70.130/wp-includes,_js,_jquery,_jquery-migrate.min.js,,qver==1.2.1,Mjm.mhpNjdU8Wl.js+wp-content,_themes,_nvapp2015_s,_js,_navigation.js,,qver==4.1,Mjm.6Nd4Vs-f7y.js+wp-content,_themes,_nvapp2015_s,_js,_skip-link-focus-fix.js,,qver==4.1,Mjm.lDnzVc-ohN.js.pagespeed.jc.qEXpdtuky-.js">    </script>    <script>eval(mod_pagespeed_bu58_vox6u);    </script>
<script>eval(mod_pagespeed_rnPp6y$Leu);    </script>
<script>eval(mod_pagespeed_v_mTWgtVPl);    </script>
<script type="text/javascript" src="http://192.168.70.130/wp-content/themes/nvapp2015_s/js/jquery-ui.min.js,qver=4.1.pagespeed.jm.e-HKoI4nbp.js">    </script>
<script type="text/javascript" src="http://192.168.70.130/wp-content/themes/nvapp2015_s/js/bootstrap.min.js,qver=4.1.pagespeed.jm.-kRHVQtEas.js">    </script>
<script src="http://192.168.70.130/wp-content/themes/nvapp2015_s/js/jquery.backstretch.min.js,,qver==4.1,Mjm.U1NgPaOuHw.js+nvapp2015-user.js,,qver==4.1,Mjm.AkFrXxuiYg.js.pagespeed.jc.P6xbyh4_sf.js">    </script>    <script>eval(mod_pagespeed_nEk421u75r);    </script>
<script>eval(mod_pagespeed_KWmGPAZujM);    </script>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://192.168.70.130/xmlrpc.php?rsd">
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://192.168.70.130/wp-includes/wlwmanifest.xml"> 
<meta name="generator" content="WordPress 4.1">
<link rel="canonical" href="http://192.168.70.130/">
<link rel="shortlink" href="http://192.168.70.130/">
    <style type="text/css">.recentcomments a{display:inline!important;padding:0!important;margin:0!important}    </style>
<style type="text/css" id="custom-background-css">body.custom-background{background-image:url(http://192.168.70.130/wp-content/uploads/2015/02/xhome-bg.png.pagespeed.ic.NgaIrW3Bbh.png);background-repeat:no-repeat;background-position:top left;background-attachment:scroll}    </style>
<style type="text/css" media="print">#wpadminbar{display:none}    </style>
<style type="text/css" media="screen">html{margin-top:32px!important}* html body{margin-top:32px!important}@media screen and (max-width:782px ){html{margin-top:46px!important}* html body{margin-top:46px!important}}    </style>
</head>

<body class="home page page-id-7 page-template page-template-nvapp2015-page-home page-template-nvapp2015-page-home-php logged-in admin-bar no-customize-support custom-background">    <noscript>&lt;meta HTTP-EQUIV="refresh" content="0;url='http://192.168.70.130/?ModPagespeed=noscript'" /&gt;&lt;style&gt;&lt;!--table,div,span,font,p{display:none} --&gt;&lt;/style&gt;&lt;div style="display:block"&gt;Please click &lt;a href="http://192.168.70.130/?ModPagespeed=noscript"&gt;here&lt;/a&gt; if you are not redirected within a few seconds.&lt;/div&gt;    </noscript>
<div id="page" class="hfeed site">
    <a class="skip-link screen-reader-text" href="#content">Skip to content    </a>

    <header id="masthead" class="site-header" role="banner">
        <div class="site-branding">
            <h1 class="site-title">    <a href="http://192.168.70.130/" rel="home">NV   </a>    </h1>
            <h2 class="site-description">NVWPDEVSPM03    </h2>
        </div>    <!-- .site-branding -->

        <nav id="site-navigation" class="main-navigation" role="navigation">
            <button class="menu-toggle" aria-controls="menu" aria-expanded="false">Primary Menu    </button>
            <div class="menu">    <ul>    <li class="page_item page-item-7 current_page_item">    <a href="http://192.168.70.130/">Home    </a>    </li>    </ul>    </div>
        </nav>    <!-- #site-navigation -->
    </header>    <!-- #masthead -->

    <div id="content" class="site-content">

    <div id="primary" class="content-area">


    </div>    <!-- #primary -->
    </div>    </div>    </body>    </html>

这里坏了...(最后 3 行)

<html lang="en-US">    <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="http://192.168.70.130/xmlrpc.php">

<title>NV | NVWPDEVSPM03    </title>
<link rel="alternate" type="application/rss+xml" title="NV » Feed" href="http://192.168.70.130/feed/">
<link rel="alternate" type="application/rss+xml" title="NV » Comments Feed" href="http://192.168.70.130/comments/feed/">
<link rel="alternate" type="application/rss+xml" title="NV » Home Comments Feed" href="http://192.168.70.130/home/feed/">
<link rel="stylesheet" id="open-sans-css" href="//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&amp;subset=latin%2Clatin-ext&amp;ver=4.1" type="text/css" media="all">
<link rel="stylesheet" id="dashicons-css" href="http://192.168.70.130/wp-includes/css/dashicons.min.css,qver=4.1.pagespeed.ce.UZxcrXP6ne.css" type="text/css" media="all">
<link rel="stylesheet" id="admin-bar-css" href="http://192.168.70.130/wp-includes/css/admin-bar.min.css,qver=4.1.pagespeed.ce.ijxCXNyHcG.css" type="text/css" media="all">
<link rel="stylesheet" id="nvapp2015-style-css" href="http://192.168.70.130/wp-content/themes/nvapp2015_s/A.style.css,qver=4.1.pagespeed.cf.bZbMpNtUMT.css" type="text/css" media="all">
<link rel="stylesheet" id="nvapp2015-bootstrap-min-style-css" href="http://192.168.70.130/wp-content/themes/nvapp2015_s/css/A.bootstrap.min.css,qver=4.1.pagespeed.cf.XAf2gFe0Gs.css" type="text/css" media="all">
<link rel="stylesheet" id="nvapp2015-font-awesome-min-style-css" href="http://192.168.70.130/wp-content/themes/nvapp2015_s/css/A.font-awesome.min.css,qver=4.1.pagespeed.cf.HpcIsdYD5q.css" type="text/css" media="all">
<link rel="stylesheet" id="nvapp2015-jquery-ui-min-style-css" href="http://192.168.70.130/wp-content/themes/nvapp2015_s/css/jquery-ui.min.css?ver=4.1" type="text/css" media="all">
<link rel="stylesheet" id="nvapp2015-google-roboto-css" href="http://fonts.googleapis.com/css?family=Roboto%3A400%2C300%2C300italic%2C400italic%2C500%2C500italic%2C700%2C700italic&amp;ver=4.1" type="text/css" media="all">
<link rel="stylesheet" id="nvapp2015-user-style-css" href="http://192.168.70.130/wp-content/themes/nvapp2015_s/css/nvapp2015-user.css?ver=4.1" type="text/css" media="all">
<script type="text/javascript" src="http://192.168.70.130/wp-includes/js/jquery/jquery.js,qver=1.11.1.pagespeed.jm.z9hb-Gxqf6.js">    </script>
<script src="http://192.168.70.130/wp-includes,_js,_jquery,_jquery-migrate.min.js,,qver==1.2.1,Mjm.mhpNjdU8Wl.js+wp-content,_themes,_nvapp2015_s,_js,_navigation.js,,qver==4.1,Mjm.6Nd4Vs-f7y.js+wp-content,_themes,_nvapp2015_s,_js,_skip-link-focus-fix.js,,qver==4.1,Mjm.lDnzVc-ohN.js.pagespeed.jc.qEXpdtuky-.js">    </script>    <script>eval(mod_pagespeed_bu58_vox6u);    </script>
<script>eval(mod_pagespeed_rnPp6y$Leu);    </script>
<script>eval(mod_pagespeed_v_mTWgtVPl);    </script>
<script type="text/javascript" src="http://192.168.70.130/wp-content/themes/nvapp2015_s/js/jquery-ui.min.js,qver=4.1.pagespeed.jm.e-HKoI4nbp.js">    </script>
<script type="text/javascript" src="http://192.168.70.130/wp-content/themes/nvapp2015_s/js/bootstrap.min.js,qver=4.1.pagespeed.jm.-kRHVQtEas.js">    </script>
<script src="http://192.168.70.130/wp-content/themes/nvapp2015_s/js/jquery.backstretch.min.js,,qver==4.1,Mjm.U1NgPaOuHw.js+nvapp2015-user.js,,qver==4.1,Mjm.AkFrXxuiYg.js.pagespeed.jc.P6xbyh4_sf.js">    </script>    <script>eval(mod_pagespeed_nEk421u75r);    </script>
<script>eval(mod_pagespeed_KWmGPAZujM);    </script>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://192.168.70.130/xmlrpc.php?rsd">
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://192.168.70.130/wp-includes/wlwmanifest.xml"> 
<meta name="generator" content="WordPress 4.1">
<link rel="canonical" href="http://192.168.70.130/">
<link rel="shortlink" href="http://192.168.70.130/">
    <style type="text/css">.recentcomments a{display:inline!important;padding:0!important;margin:0!important}    </style>
<style type="text/css" id="custom-background-css">body.custom-background{background-image:url(http://192.168.70.130/wp-content/uploads/2015/02/xhome-bg.png.pagespeed.ic.NgaIrW3Bbh.png);background-repeat:no-repeat;background-position:top left;background-attachment:scroll}    </style>
<style type="text/css" media="print">#wpadminbar{display:none}    </style>
<style type="text/css" media="screen">html{margin-top:32px!important}* html body{margin-top:32px!important}@media screen and (max-width:782px ){html{margin-top:46px!important}* html body{margin-top:46px!important}}    </style>
</head>

<body class="home page page-id-7 page-template page-template-nvapp2015-page-home page-template-nvapp2015-page-home-php logged-in admin-bar no-customize-support custom-background">    <noscript>&lt;meta HTTP-EQUIV="refresh" content="0;url='http://192.168.70.130/?ModPagespeed=noscript'" /&gt;&lt;style&gt;&lt;!--table,div,span,font,p{display:none} --&gt;&lt;/style&gt;&lt;div style="display:block"&gt;Please click &lt;a href="http://192.168.70.130/?ModPagespeed=noscript"&gt;here&lt;/a&gt; if you are not redirected within a few seconds.&lt;/div&gt;    </noscript>
<div id="page" class="hfeed site" style="position: relative; z-index: 0; background: none;">
    <a class="skip-link screen-reader-text" href="#content">Skip to content    </a>

    <header id="masthead" class="site-header" role="banner">
        <div class="site-branding">
            <h1 class="site-title">    <a href="http://192.168.70.130/" rel="home">NV    </a>    </h1>
            <h2 class="site-description">NVWPDEVSPM03    </h2>
        </div>    <!-- .site-branding -->

        <nav id="site-navigation" class="main-navigation" role="navigation">
            <button class="menu-toggle" aria-controls="menu" aria-expanded="false">Primary Menu    </button>
            <div class="menu">    <ul>    <li class="page_item page-item-7 current_page_item">    <a href="http://192.168.70.130/">Home    </a>    </li>    </ul>    </div>
        </nav>    <!-- #site-navigation -->
    </header>    <!-- #masthead -->

    <div id="content" class="site-content">

    <div id="primary" class="content-area">


    </div>    <!-- #primary -->
    <input type="hidden" id="bg_image" value="    <script pagespeed_no_defer=" "="">//    <!--[CDATA[
(function(){var e=encodeURIComponent,f=window,h=document,m="width",n="documentElement",p="height",q="length",r="prototype",s="body",t="&",u="&ci=",w="&n=",x="&rd=",y=",",z="?",A="Content-Type",B="Microsoft.XMLHTTP",C="Msxml2.XMLHTTP",D="POST",E="application/x-www-form-urlencoded",F="img",G="input",H="load",I="oh=",J="on",K="pagespeed_url_hash",L="url=",M=function(a,c,d){if(a.addEventListener)a.addEventListener(c,d,!1);else if(a.attachEvent)a.attachEvent(J+c,d);else{var b=a[J+c];a[J+c]=function(){d.call(this);b&&b.call(this)}}};f.pagespeed=f.pagespeed||{};var N=f.pagespeed,O=function(a,c,d,b,g){this.d=a;this.f=c;this.g=d;this.a=g;this.c={height:f.innerHeight||h[n].clientHeight||h[s].clientHeight,width:f.innerWidth||h[n].clientWidth||h[s].clientWidth};this.e=b;this.b={}};O[r].j=function(a){a=a.getBoundingClientRect();return{top:a.top+(void 0!==f.pageYOffset?f.pageYOffset:(h[n]||h[s].parentNode||h[s]).scrollTop),left:a.left+(void 0!==f.pageXOffset?f.pageXOffset:(h[n]||h[s].parentNode||h[s]).scrollLeft)}};O[r].i=function(a){if(0-->=a.offsetWidth&amp;&amp;0&gt;=a.offsetHeight)return!1;a=this.j(a);var c=a.top.toString()+y+a.left.toString();if(this.b.hasOwnProperty(c))return!1;this.b[c]=!0;return a.top&lt;=this.c[p]&amp;&amp;a.left&lt;=this.c[m]};O[r].l=function(){for(var a=[F,G],c=[],d={},b=0;b    <a[q];++b)for(var g="h.getElementsByTagName(a[b]),k=0;k    <g[q];++k){var" v="g[k].getAttribute(K);v&amp;&amp;g[k].getBoundingClientRect&amp;&amp;this.i(g[k])&amp;&amp;!(v" in="" d)&&(c.push(v),d[v]="!0)}b=!1;a=I+this.g;this.a&amp;&amp;(a+=w+this.a);if(0!=c[q]){a+=u+e(c[0]);for(b=1;b    <c[q];++b){d=y+e(c[b]);if(131072    <a[q]+d[q])break;a+=d}b=!0}this.e&amp;&amp;(d=x+e(JSON.stringify(this.h())),131072">=a[q]+d[q]&amp;&amp;(a+=d),b=!0);N.criticalImagesBeaconData=a;if(b){var c=this.d,b=this.f,l;if(f.XMLHttpRequest)l=new XMLHttpRequest;else if(f.ActiveXObject)try{l=new ActiveXObject(C)}catch(P){try{l=new ActiveXObject(B)}catch(Q){}}l&amp;&amp;(l.open(D,c+(-1==c.indexOf(z)?z:t)+L+e(b)),l.setRequestHeader(A,E),l.send(a))}};O[r].h=function(){for(var a={},c=h.getElementsByTagName(F),d=0;d    <c[q];++d){var b="c[d],g=b.getAttribute(K);if(&quot;undefined&quot;==typeof" b.naturalwidth||"undefined"="=typeof" b.naturalheight||"undefined"="=typeof" g)break;if("undefined"="=typeof" a[b.src]&&0    <b[m]&&0    <b[p]&&0    <b.naturalwidth&&0    <b.naturalheight||"undefined"!="typeof" a[b.src]&&b[m]="">=a[b.src].n&amp;&amp;b[p]&gt;=a[b.src].m)a[g]={renderedWidth:b[m],renderedHeight:b[p],originalWidth:b.naturalWidth,originalHeight:b.naturalHeight}}return a};N.k=function(a,c,d,b,g){var k=new O(a,c,d,b,g);M(f,H,function(){f.setTimeout(function(){k.l()},0)})};N.criticalImagesBeaconInit=N.k;})();pagespeed.criticalImagesBeaconInit('/mod_pagespeed_beacon','http://192.168.70.130/','O-_tWHm2s1',false,'qIBIt6eWWcg');
//]]&gt;    </c[q];++d){var>    </a[q];++b)for(var>    </div>    <div class="backstretch" style="left: 0px; top: 0px; overflow: hidden; margin: 0px; padding: 0px; height: 100%; width: 100%; z-index: -999998; position: absolute;">    <img src="&lt;script pagespeed_no_defer=" style="position: absolute; display: none; margin: 0px; padding: 0px; border: none; width: auto; height: auto; max-height: none; max-width: none; z-index: -999999;">    </div>    </div>    </body>    </html>

解决方法:如果我在 httpd.conf 中禁用 pagespeed,问题就会消失。