我在web层上有下面的架构。
Varnish <-> Apache2 (mod_pagespeed <-> mod_jk) <-> Tomcat
^ ^ ^
| | |________: mod_jk
| |_______________________________________________: port 8080
|__________________________________________________________: port 80默认配置安装了清漆和mod_pagespeed。
现在,当我访问url http://example.org:8080时,我可以在源代码中看到mod_pagespeed是被调用的,并且重写了页面(在第二次刷新中,因为它不是第一次缓存的)。
但是,当我访问url时,http://example.org:80 mod_pagespeed不会被调用,并且html代码将不受影响地呈现。
下面显示在每个连接上接收到的http标头
PORT 80
< Server: Apache/2.2.14 (Ubuntu)
< Set-Cookie: JSESSIONID=95ABA0EB57ACCBE15C9D7035C4397BD3; Path=/
< X-Mod-Pagespeed: 0.9.17.7-716
< Cache-Control: max-age=0, no-cache, no-store
< Vary: Accept-Encoding
< Content-Type: text/html;charset=UTF-8
< Content-Length: 13234
< Date: Wed, 01 Jun 2011 12:17:11 GMT
< X-Varnish: 579414176
< Age: 0
< Via: 1.1 varnish
< Connection: keep-alive
PORT 8080 (mod_pagespeed working fine)
< Date: Wed, 01 Jun 2011 12:19:26 GMT
< Server: Apache/2.2.14 (Ubuntu)
< Set-Cookie: JSESSIONID=DC3759CDE52D3B63A785F9C97B005EC0; Path=/
< X-Mod-Pagespeed: 0.9.17.7-716
< Cache-Control: max-age=0, no-cache, no-store
< Vary: Accept-Encoding
< Content-Length: 15990
< Content-Type: text/html;charset=UTF-8 有人知道为什么会发生这种事吗?它是mod_pagespeed中的一个bug吗?它是由在清漆或mod_pagespeed中设置的配置设置引起的吗?
任何帮助进一步深入这个问题是非常感谢的。
发布于 2011-06-02 16:45:59
在后端服务器上使用mod_pagespeed时,可能会遇到许多配置缺陷,因为后端服务器接收的URL与最终用户看到的URL不同。
您的响应都有X Pagespeed: headers,因此mod_pagespeed在每个头上运行,但是它可能无法加载子资源(CSS、JS、映像),因此不会重写它们中的任何一个。
请在mod页面讨论@googlegroups.com上跟进,我们可以帮你解决这个问题。
https://serverfault.com/questions/276628
复制相似问题