Apache页面压缩配置问题导致json数据传输时间延长
2013-06-03 18:03
1331 查看
为加快js文件的下载速度,启用了apache服务器的页面压缩功能。
LoadModule deflate_module modules/mod_deflate.so
......
<IfModule deflate_module>
DeflateCompressionLevel 9
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter DEFLATE css js
</IfModule>
发现ext-all.js等js文件的传输时间明显减少,但是查询服务器返回json数据时间大大延长,原来每次大约为100ms,现在每次大约为5.5秒。
经过追踪,发现原因是apache压缩配置,改为
<IfModule deflate_module>
DeflateCompressionLevel 9
#AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
#AddOutputFilterByType DEFLATE text/html
#AddOutputFilterByType DEFLATE text/json application/json text/x-json application/x-json
AddOutputFilterByType DEFLATE text/json
AddOutputFilter DEFLATE css js
</IfModule>
这样可能牺牲部分文件的传输速度,但json数据的速度明显加快。
LoadModule deflate_module modules/mod_deflate.so
......
<IfModule deflate_module>
DeflateCompressionLevel 9
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter DEFLATE css js
</IfModule>
发现ext-all.js等js文件的传输时间明显减少,但是查询服务器返回json数据时间大大延长,原来每次大约为100ms,现在每次大约为5.5秒。
经过追踪,发现原因是apache压缩配置,改为
<IfModule deflate_module>
DeflateCompressionLevel 9
#AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
#AddOutputFilterByType DEFLATE text/html
#AddOutputFilterByType DEFLATE text/json application/json text/x-json application/x-json
AddOutputFilterByType DEFLATE text/json
AddOutputFilter DEFLATE css js
</IfModule>
这样可能牺牲部分文件的传输速度,但json数据的速度明显加快。
相关文章推荐
- Apache页面压缩配置问题导致json数据传输时间延长
- Apache页面压缩配置问题导致json数据传输时间延长
- 微信小程序——wx.navigateTo中url无法跳转问题(app.json中配置的tabBar与wx.navigateTo中url引用相同页面导致)(2017/12)
- 微信小程序:wx.navigateTo中url无法跳转问题(app.json中配置的tabBar与wx.navigateTo中url引用相同页面导致)
- Hibernate懒加载导致json数据对象传输异常的问题---(非常重要)
- 配置一对多导致json转换错误,数据无法展现的问题
- 分布式架构项目中各模块中页面发送ajax请求后台json数据的传输问题
- 解决在OFFICE平台传输数据慢的问题,使用GZIP+JSON替代WEBSERVICE提供数据
- Json数据由于数组下标未重置导致的格式问题
- 配置win2003 server IIS的总结,为什么IIs的工作进程会在空闲时间释放的问题。同时学会了throw的真正含义,throw的真正含义就是导致程序停止,崩溃,很简单,网摘也有记录。
- JSON通过配置文件格式化时间属性(解决[object Object]问题)
- Json传输数据问题之Can't assign value '0' (type System.Double) to type System.Single
- 移动Web开发,数据压缩,后端压缩传输的json格式数据
- ajax页面无刷新 IE下遭遇Ajax缓存导致数据不更新的问题
- springMvc如何和前端页面交互,传输json数据
- thinkcmf5更新模板代码分析,解决模板配置json出错导致数据库保存的配置项内容丢失问题
- 关于ajax 返回的json数据动态展现在jsp页面的问题 20170525
- curl乱码有两个方面的原因一个是因为我们采集页面的php页面编码与远程文档编码不致导致的,另一种可能是页面进入了gzip压缩传输导致的
- 页面使用$.getJSON只获取一次数据,导致多个请求返回的都是第一个结果
- SpringMVC 返回Java8 时间JSON数据的格式化问题处理