Re: lzlib usage
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: lzlib usage
- From: Petite Abeille <petite_abeille@...>
- Date: 2010年1月28日 20:44:47 +0100
On Jan 28, 2010, at 8:40 PM, Phoenix Sol wrote:
> Anyone have any intel on this library, lzlib
Tiago Dionizio's lzlib?
http://luaforge.net/projects/lzlib/
If yes, here is an usage example:
local ok, zlib = pcall( require, 'zlib' )
if ok and zlib then
local aContent = tostring( aResponse.content )
local zContent = zlib.compress( aContent, 9, nil, 15 + 16 )
if zContent:len() < aContent:len() then
aResponse.header[ 'content-encoding' ] = 'gzip'
aResponse.header[ 'etag' ] = nil
aResponse.content = zContent
end
end
http://dev.alt.textdrive.com/browser/HTTP/HTTPExtra.lua#L212