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...
JanStiller T-Online wrote:
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. [...]
IMNSHO, mod_gzip does (can do) caching on its own (directives "mod_gzip_keep_workfiles" and "mod_gzip_temp_dir"), and perhaps it might work with mod_proxy in some intelligent way. Maybe you might want to check this first before doing too much work. Also be warned, there are certain kinds of documents which will make problems when served compressed, like PDFs. While you won't want to RAM-cached PDFs, it might occur that RAM-caching and compressing do conflict. cheers, oliver
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 )
participants (3)
-
Adrian Hungate -
JanStiller@t-online.de -
Oliver Bleutgen