This is a wsgi middleware application intended for use with paste.deploy, zope.paste, and zope3.
It serves as a wsgi filter to gzip output from a zope3 application.
for zope3, zif.gzipper requires Sidnei da Silva's zope.paste
zope.paste is available at http://svn.zope.org/zope.paste/trunk/
cd [path.to.zope3.src.directory]/zope svn co http://svn.zope.org/zope.paste/trunk/ paste
zope.paste is also available at the cheese shop .
Instructions for zope.paste are at http://awkly.org/2006/01/25/zopepaste-wsgi-applications-in-zope-3-using-pastedeploy/
zope.paste requires paste.deploy. paste.deploy may be obtained from the cheese shop . Presuming you have setuptools installed,
sudo easy_install.py PasteDeploy
This (zif.gzipper) package can be unzipped and installed anywhere on the Python path.
Follow Sidnei's instructions for setting up zope.paste. It involves putting the usual zope.paste-configure.zcml file in [zope3 instance]/etc/site-packages. There is also a parameter to change in [zope3 instance]/etc/zope.conf. The new twist is a paste.ini file in [zope3 instance]/etc
My paste.ini file looks like:
[pipeline:Paste.Main] pipeline = gzipper jsmin main [app:main] paste.app_factory = zope.paste.application:zope_publisher_app_factory [filter:gzipper] paste.filter_factory=zif.gzipper.gzipper:filter_factory compress_level=6 exclude=localimages nocompress=jp gz zip png tempfile=1048576 [filter:jsmin] paste.filter_factory=zif.jsmin.jsmin:filter_factory compress_level=safe
gzipper should be the first filter in the pipeline. Other filters will have a hard time reading compressed data output from this filter.
The paste.ini file above shows examples of the configuration options for gzipper .