注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

老和山小和尚

敬天爱人

 
 
 

日志

 
 
 
 

[ANNOUNCE] add the gzip feature to squid-2.7 on the fly  

2010-07-22 11:21:05|  分类: 其他服务软件 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
This patch adds the feature of http compression on the fly for squid-2.7

=INSTALLATION=

Get the squid-2.7 source from http://www.squid-cache.org/Versions/v2/2.7/
Get the patch from http://github.com/yaoweibin/squid_gzip

cd squid-2.7
patch -p1 < /path/to/http_gzip.patch

compile squid with the following command:

./bootstrap.sh && ./configure --enable-http-gzip && make

=EXAMPLE=
I have tested in accelerator mode.
<code>
http_gzip on
http_gzip_types text/html,text/plain
</code>

=DIRECTIVES=
    ==http_gzip==
    syntax: http_gzip on|off
    default: on
    context: main
    description: switch the http compression

    ==http_gzip_prefer_gzip==
    syntax: http_gzip_prefer_gzip on|off
    default: on
    context: main
    description: sends gzip content to user agents who can accept both
    gzip and deflate content.

    ==http_gzip_prefer_deflate==
    syntax: http_gzip_prefer_deflate on|off
    default: on
    context: main
    description: sends deflate content to user agents who can accept
    both gzip and deflate content. If prefer_deflate and perfer_gzip are
    both on. deflate is higher priority than gzip.

    ==http_gzip_types==
    syntax: http_gzip_types [mime types]
    default: text/html
    context: main
    description: This directive set the MIME types list which need to be
    compressed. The types need be separated by ',' and there should not
    be any space between types.

    ==http_gzip_hash==
    syntax: http_gzip_hash memLevel
    default: 8
    context: main
    description: The memlevel parameter specifies how much memory should be
    allocated for the internal compression state. memLevel=1 uses minimum memory
    but is slow and reduces compression ratio; memLevel=9 uses maximum memory
    for optimal speed.

    ==http_gzip_comp_level==
    syntax: http_gzip_comp_level level
    default: 9
    context: main
    description: The compression level, between 1 and 9, where 1 is the
    least compression (fastest) and 9 is the most (slowest).

    ==http_gzip_min_length==
    syntax: http_gzip_min_length length
    default: 0
    context: main
    description: Sets the minimum length of of the response that will be
    compressed. Responses shorter than this will not be compressed. Length is
    determined from the "Content-Length" header.

    ==http_gzip_window==
    syntax: http_gzip_window windowBits
    default: 15
    context: main
    description: The windowBits parameter is the base two logarithm of the
    window size (the size of the history buffer). It should be in the range
    8..15 for this version of the library. Larger values of this parameter
    result in better compression at the expense of memory usage.

    ==http_gzip_prealloc==
    syntax: http_gzip_prealloc size
    default: 256 KB
    context: main
    description: We preallocate a memory for zlib in one buffer (default:
    256K), this decreases a number of malloc() and free() calls and also
    probably decreases a number of syscalls (sbrk()/mmap() and so on).

=TODO=

=LICENSE=

Copyright (c) 2010, Netease Inc. ( http://www.netease.com ).

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License (version 2) as
published by the Free Software Foundation. It is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.

Questions/patches may be directed to Weibin Yao, yaoweibin@gmail.com
  评论这张
 
阅读(937)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017