Tomcat7压缩由于某种原因无法正常工作 [英] Tomcat7 Compression not working for some reason

查看:107
本文介绍了Tomcat7压缩由于某种原因无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在tomcat7上配置压缩时遇到了一些问题,场景是我在客户端网站上工作,我必须打开服务器上的压缩在tomcat7上。所以我发现这样做的方法是修改... \ tomcat7.0 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ br />

Hi Everyone,
I''m facing some issue in configuring compression on tomcat7, scenario is that i''m working on client site where i''ve to turn on the compression on server on tomcat7. so what i''ve found the way to do this is to modify ...\tomcat7.0\conf\server.xml file and add some line to enable the compression.

<Connector port="80" protocol="HTTP/1.1"

               connectionTimeout="20000"

               redirectPort="8443"

		compression="on"

		compressionMinSize="2048"

		nocompressionUserAgents="gozilla, traviata"

	compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,text/json,application/x-javascript,application/javascript,application/json" />





但不幸的是它不是工作,当我用chrome打开应用程序并检查''Content-Encoding:gzip''时,它也不在那里。虽然有趣的是,使用相同的安装程序,我已经在我的本地机器上使用windows7安装了tomcat7,压缩工作正常。但不适用于拥有Windows Server 2008 R2的客户端系统。



我也在Google上搜索任何解决方案或线索,但每个站点只发现两件事1 )如何配置所有站点上相同的压缩,2)如果不工作则清除浏览器缓存。还没有找到任何其他解决方案。



所以你身边的任何帮助都表明它不能在客户端PC上运行,但在我当地的PC上工作正常。



but unfortunately its not working and when i open application in chrome and check for ''Content-Encoding:gzip'' then also its not there. while interesting thing is that using same installers i''ve installed tomcat7 on my local machine with windows7 and compression is working fine on it. but not on client system that has Windows Server 2008 R2.

i''me also searching on Google for any solution or clue but found only two things on every site 1) how to configure for compression which is the same on all sites, 2) if not working then clear browser cache. could not found any other solution yet.

so any help from your side that its not working on Client PC but working fine on my local one.

推荐答案

要检查的第一件事......所以你已经在本地机器上安装了tomcat ......你在客户端机器上安装了它吗?确保它在那里 - 启用压缩并安装tomcat服务器是不一样的。



如果你还有问题,那么发一个问题到tomcat邮件列表 http://tomcat.apache.org/lists.html [ ^ ]
First thing to check ... So you''ve installed tomcat on your local machine ... have you installed it on the client machine? Make sure that it''s on there - enabling the compression and installing the tomcat server are not the same thing.

If you still have issues then post a question to the tomcat mailing list http://tomcat.apache.org/lists.html[^]


我发现在访问时停止压缩的重点来自用户PC的应用程序(不是来自应用程序服务器内部)。问题是浏览器配置了代理,因此tomcat压缩无法通过代理工作。



i通过直接在服务器上测试压缩以及通过访问应用程序来找到没有代理连接到服务器的系统。所以我告诉IT人员在代理设置规则中为这个URL添加例外并解决我的问题。
i Found the point that stopping compression when im accessing application from users PC (not from inside the application server). the issue was that browser has proxy configured so tomcat compression was not working through proxy.

i found this by testing the compression directly on server and also by accessing the application through a system that is connected to the server without proxy. so then i''ve told the IT guys to add exception for this URL in proxy settings rules and that solve me problem.


这篇关于Tomcat7压缩由于某种原因无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆