启用pagespeed时,标记在ajax文件中自动生成

时间:2014-10-20 11:41:42

标签: pagespeed

我在apache服务器中启用了pagespeed。因为<head/>会自动在所有ajax文件中创建。

例如,当我看到使用Firebug的响应标记时,我得到以下输出:

<head/><p>
Images below the fold (the ones lower than window bottom) are not loaded. When scrolling down
they are loaded when needed. Empty cache and shift-reload to test again. Compare this to page
where plugin is <a href="disabled.html">disabled</a>, same page with
<a href="enabled_fadein.html">fadein effect</a>, page with <a href="enabled_wide.html">wide
layout</a> or wide content <a href="enabled_wide_container.html">inside container</a>.
</p>

而不是:

<p>
Images below the fold (the ones lower than window bottom) are not loaded. When scrolling down
they are loaded when needed. Empty cache and shift-reload to test again. Compare this to page
where plugin is <a href="disabled.html">disabled</a>, same page with
<a href="enabled_fadein.html">fadein effect</a>, page with <a href="enabled_wide.html">wide
layout</a> or wide content <a href="enabled_wide_container.html">inside container</a>.
</p> 

如何删除<head/>代码?

3 个答案:

答案 0 :(得分:0)

这是由默认的mod_pagespeed add_head过滤器添加的。您可以使用以下命令禁用它:

ModPagespeedDisableFilters add_head

但请注意,许多其他过滤器都需要此过滤器,这些过滤器只会在元素中写入内容。

答案 1 :(得分:0)

或许最简单的方法是激活“ OptimizeForBandwidth ”重写级别而不是CoreFilters

ModPagespeedRewriteLevel OptimizeForBandwidth

答案 2 :(得分:0)

可能比其他两种选择都容易。在php中将标题设置为其他html / txt:

header("Content-type: text/xml");

似乎可以解决问题。

相关问题