We are trying to serve some of our overlarge Javascript programs using mod_deflate to reduce network traffic and hopefully speed up load
times on your end. This could potentially make a lot of difference.
Normal:
$ curl http://semantic.xxx.org/:root/packed/MochiKit_standard.js --head
HTTP/1.1 200 OK
Date: Mon, 07 May 2007 12:09:02 GMT
Server: Apache/2.0.59 (Unix) DAV/2 mod_python/3.2.10 Python/2.4.4
Last-Modified: Sun, 06 May 2007 11:58:48 GMT
ETag: "bf4172-3659a-e83cae00"
Accept-Ranges: bytes
Content-Length: 222618
Vary: Accept-Encoding
Connection: close
Content-Type: application/x-javascript
Compressed:
$ curl http://semantic.xxx.org/:root/packed/MochiKit_standard.js --compressed --head
HTTP/1.1 200 OK
Date: Mon, 07 May 2007 12:08:50 GMT
Server: Apache/2.0.59 (Unix) DAV/2 mod_python/3.2.10 Python/2.4.4
Last-Modified: Sun, 06 May 2007 11:58:48 GMT
ETag: "bf4172-3659a-e83cae00"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 55248
Connection: close
Content-Type: application/x-javascript
But unfortunately, we couldn't start Apache because we were getting the following error:
actl semantic/semantic start
Syntax error on line 862 of /usr/blogmatrix/apache/semantic/semantic/conf/httpd.conf:
Cannot load /usr/blogmatrix/apache/semantic/semantic/modules/mod_deflate.so into server:
/usr/blogmatrix/apache/semantic/semantic/modules/mod_deflate.so: undefined symbol: deflate
The
solution turns out to be fairly simple -- just add LoadFile for zlib into the apache conf
LoadFile /usr/lib/libz.so
LoadModule deflate_module modules/mod_deflate.so
AddOutputFilterByType DEFLATE application/x-javascript text/javascript text/css