[Zope-dev] RAMCacheManager and gzip

Adrian Hungate adrian@haqa.co.uk
Mon, 10 Dec 2001 00:44:13 -0000


There is zlib support in Python, and it is used in Medusa already. ZServer
does not call it, but the compression stuff is there.

There is one good reason not to use zlib though, Micro$oft Internet
Distorter does not support content-encoding: gzip and for content-encoding:
compress it expects data to be compressed using the Unix compress tool... (I
think someone reported this already... oh well)

This one needs more work.

Netscape 4.7 (Latest version of communicator) does not support HTTP1.1 at
all, so it can not do content-encoding at all. (This was a complete supprise
to me - Netscape list this as their current version of communicator!)

I have to download the latest Mozilla and Netscape 6.2 and see if they work
properly. I suspect this is a non-starter as the support is not reliably
present in the clients.

I don't see any reason to continue this as a project - even if Mozilla and
Netscape 6.x support content encoding properly, and even if the smaller
browsers (Noteably Opera I guess) support it, so many people use MSID that
this would be a major problem - All pages would fail to display as MSID
reports that it does HTTP1.1 !!!

I do have another server-side caching project that I am about to start
looking at though, so we might still see some speed improvements.

Adrian...

--
Adrian Hungate

All views expressed in this email are those of the whole world, however some
people don't realise this yet.

----- Original Message -----
From: "JanStiller T-Online" <JanStiller@t-online.de>
To: "Adrian Hungate" <adrian@haqa.co.uk>
Sent: Sunday, December 09, 2001 6:33 PM
Subject: RE: [Zope-dev] RAMCacheManager and gzip


> ;o)
>
> I think that zlib would be the best, too. But, I think that - while trying
> mod_gzip - I read somewhere that zlib isn't thread-safe. Maybe you want to
> check this out...
>
> I primarily asked because I have no experience in making Python calls to a
> .so, so I spawn an os.system everytime - which doesn't matter that much
> because my cache lasts for several days, but it's nonetheless :o(
>
>
> ciao Jan
>
>
>
>
> > -----Original Message-----
> > From: Adrian Hungate [mailto:adrian@haqa.co.uk]
> > Sent: Samstag, 8. Dezember 2001 00:42
> > To: JanStiller T-Online
> > Subject: Re: [Zope-dev] RAMCacheManager and gzip
> >
> >
> > I intend to use zlib, (Infact I may just slot in a
> > ZServer.medusa.producers.compressed_producer somewhere) why is there a
> > better one that I can be sure exists on every platform?
> >
> > Adrian...
> >
> > --
> > Adrian Hungate
> >
> > All views expressed in this email are those of the whole world,
> > however some
> > people don't realise this yet.
> >
> > ----- Original Message -----
> > From: "JanStiller T-Online" <JanStiller@t-online.de>
> > To: "Adrian Hungate" <adrian@haqa.co.uk>
> > Sent: Thursday, December 06, 2001 10:35 PM
> > Subject: RE: [Zope-dev] RAMCacheManager and gzip
> >
> >
> > >
> > > definitely yes. But don't you think, optionally caching the
> > zipped results
> > > would be interesting? If you have a shop, that doesn't offer up to
date
> > > information about product availability (like I do), storing the
results
> > > would be a cool thing IMHO. You save many, many compress-calls
> > per day and
> > > caching about 10,000 items takes according to my first tests about 15M
> > RAM.
> > > I find this idea quite appealing, if your database selects are
> > expensive.
> > >
> > > btw: Which compression function do you plan to use?
> > >
> > >
> > > looking forward  Jan
> > >
> > > p.s.: I have a quick'n'dirty prototype running, if you're
interested...
> > >
> > >
> > > > -----Original Message-----
> > > > From: Adrian Hungate [mailto:adrian@haqa.co.uk]
> > > > Sent: Donnerstag, 6. Dezember 2001 22:30
> > > > To: JanStiller T-Online; zope-dev@zope.org
> > > > Subject: Re: [Zope-dev] RAMCacheManager and gzip
> > > >
> > > >
> > > > Just to let you know, I am looking at patching ZServer using
> > my PatchKit
> > > > product to do "Content-Encoding: ..." stuff... anyone interested
> > > > in testing
> > > > when I get it running?
> > > >
> > > > (Probably a couple of days before I get a running version...)
> > > >
> > > > Adrian...
> > > >
> > > > --
> > > > Adrian Hungate
> > > >
> > > > All views expressed in this email are those of the whole world,
> > > > however some
> > > > people don't realise this yet.
> > > >
> > > > ----- Original Message -----
> > > > From: "JanStiller T-Online" <JanStiller@t-online.de>
> > > > To: <zope-dev@zope.org>
> > > > Sent: Wednesday, October 31, 2001 4:50 AM
> > > > Subject: [Zope-dev] RAMCacheManager and gzip
> > > >
> > > >
> > > > > Hi,
> > > > >
> > > > > Is it possible to marry the RAMCacheManager and gzip?
> > > > >
> > > > > I'm just working on a little shop and - for speed's sake - do
> > > > 'ram-cache'
> > > > > the article-listings and push all the Zope-Content through
> > > > mod_gzip. With
> > > > > this combination, I'm getting it 3x faster in Zope and 5x
> > > > faster over the
> > > > > wire (normally 64k). That's great so far. But I don't see
> > any sense in
> > > > > zipping cached content over and over, so I tried to zip the
> > > > cached data in
> > > > > RAMCacheManager. In my first attempt, i replaced:
> > > > >
> > > > >
> > > > > ZCache_get (RAMCacheManager.py):
> > > > >
> > > > >         entry.access_count = entry.access_count + 1
> > > > >         return entry.data
> > > > >
> > > > > with:
> > > > >
> > > > >         entry.access_count = entry.access_count + 1
> > > > >
ob.REQUEST.RESPONSE.setHeader('Content-Encoding','compress')
> > > > >         return zlib.compress(entry.data)
> > > > >
> > > > >
> > > > > The results:
> > > > >
> > > > > 1.
> > > > > This works with Mozilla 0.96 only for very small entry.data. When
I
> > set
> > > > > entry.data to 'XX', it works, but any real page gets
> > > > > '<html><body></html></body>' as the result.
> > > > >
> > > > > 2.
> > > > > This doesn't seem work in IE alltogether. (with
> > > > 'Content-Encoding: gzip' -
> > > > > zlib.compress != gzip!?)
> > > > >
> > > > >
> > > > > I'm willing to spend some days of work for this feature,
> > but although
> > I
> > > > have
> > > > > 2 years experience in Python I'm quite new to Zope and
> > > > Internet-RFCxxxx's
> > > > > and this is definitely a point, where I would appreciate some
hints
> > from
> > > > > more experienced Zope-programmers (or a product, of course -- or
the
> > > > > statement, that this won't be possible... ;o)
> > > > >
> > > > >
> > > > >
> > > > > regards
> > > > >
> > > > > Jan Stiller
> > > > >
> > > > >
> > > > > P.S. sorry, if my words seems a bit confused, I'm more used
> > to reading
> > > > than
> > > > > writing english...
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Zope-Dev maillist  -  Zope-Dev@zope.org
> > > > > http://lists.zope.org/mailman/listinfo/zope-dev
> > > > > **  No cross posts or HTML encoding!  **
> > > > > (Related lists -
> > > > >  http://lists.zope.org/mailman/listinfo/zope-announce
> > > > >  http://lists.zope.org/mailman/listinfo/zope )
> > > > >
> > > >
> > >
> >
>