[AWS] gzip content - at AWS or proxy level?

Pascal Obry pascal at obry.net
Mon Jan 3 12:06:31 CET 2011


Thomas,

> As progress is being made on my PHP/Apache->AWS migration, various
> questions emerge. The latest is "where to do the gzip'ing of content?"
>
> I intend to run multiple AWS applications behind a proxy (probably
> Apache), so my choices are pretty clear:
>
>    1. gzip content in the AWS application.
>    2. gzip content as it is passing through Apache.
>
> Currently I'm leaning towards the latter option, using a simple
> AddOutputFilterByType directive. It seems the easiest solution, and
> from some initial tests, it seems to work just fine.

Well, compressing in AWS is not harder I would say:

   Response.Build (..., Encoding => Messages.Gzip);

> But how would you do it? Are there some specific advantages to letting
> AWS handle compression of content?

I don't know how Apache does it. But I would say:

   - AWS user API is simple

   - AWS implementation should be fast (no external process used, is that
     the case for Apache too? I expect so...)

   - AWS can stream large content and gzip the stream, not need to build
     the whole message body first). Your second solution will impose that.

I would also add that if some static data are to be send encoded it is better
to encode first and send them encoded. You don't want to gzip multiple
time the same file. This is done in v2p by caching the gziped files (CSS for
example). Not complex to do in Ada.

That's my experiences...

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595


More information about the AWS mailing list