gzip encoding/compressing ZWiki pages
I had been gzip encoding/compressing my COREBlog pages for some time now, now I thought about doing the same for my ZWiki pages at the papaki. There are two approaches:
- Using mod_gzip with apache. Not preinstalled in OpenBSD, but there is a package which I downloaded, but haven't installed yet.
- Then we have also the option in Zope to add gzip encoding with one simple directive in whatever pages we want:
tal:define="just_call python:context.REQUEST.RESPONSE.enableHTTPCompression(context.REQUEST)tal:define="just_call python:request.RESPONSE.enableHTTPCompression(request)" Since I already use my own wikipage.pt to restyle the wiki pages, I just put this directive in there.
Likely using mod_gzip would be considered the better solution. For some reason I just never got around to installing and using it. I guess the reason is just what brought me to use the gzip support in Zope in the first place: It's easy to set up. It works only on the pages you tell it to (now that could be considered a downside too), but it's easy to assign to those pages you want, no messing with regular expressions in httpd.conf to try to "catch" zope pages. I imagine that using mod_gzip would be easier on the server's RAM usage, but I have no hard figures to prove or disprove that. I'll keep it on my to-do list to play around with.
For now my wiki pages are still quite small. But I imagine that the usual huge wiki pages would profit a lot from gzip compression. Next on my list is If-modified-since support for ZWiki pages, another fun project with bandwidth payoff. sm mentioned that there is already some setup for that for ZWiki stylesheets (and some other parts) in the code.