[Seaside] Kom/Seaside/Apache, gzip?

Lukas Renggli renggli at gmail.com
Thu Mar 23 08:55:34 UTC 2006


> Gziping content makes a huge difference with our applications. Does
> Kom support this? If it does not appear that it would be a huge
> undertaking. Any pointers on where to begin ?

You could subclass WAKom and start with something like:

WAKomCompressed>>convertResponse: aResponse
	| response gzip stream |
	response := super convertResponse: aResponse.
	response fieldAt: 'Content-Encoding' put: 'gzip'.
	gzip := GZipWriteStream on: (stream := RWBinaryOrTextStream on: '').
	gzip nextPutAll: aResponse contents contents; close.
	^ response contents: stream reset

This code does not check if the user-agent supports compressed
responds, most todays user-agents do that anyway and one could add it
easily.

However I doubt that this will make the web-application any snappier,
I guess it is even much slower because the stream has to be copied to
a compressed one. After all the XHTML of Seaside is already quite
dense, there are no unnecessary spaces as with most other frameworks.

It is a bit trickier and requires some modifications to Seaside if you
want to directly stream you answer into a compressed stream, tough it
should be possible.

> Does anyone know if Apache can act a a gzip proxy ? Gziping non-ziped
> content served from seaside. Has any one done this? Any examples?

I never felt the need to do anything like that, the bottleneck is
usually the persistency backend or the domain-model itself, not the
network connection.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


More information about the Seaside mailing list