[nodejs] HTTP - how to send multiple pre-cached gzipped chunks?

2013-05-24 Thread Sławek Janecki
Lets say I have 2 individually gziped html chunks in memory. Can I send chunk1+chunk2 to HTTP client? Does any browser supports this? Or there is no way to do this and I have to gzip the whole stream not individual chunks? I want to serve to clients for example chunk1+chunk2 and chunk2+chunk1

Re: [nodejs] HTTP - how to send multiple pre-cached gzipped chunks?

2013-05-24 Thread Tim Caswell
gzip has internal headers that must only appear at the beginning. You can't send two gzip documents in the same document. The browsers don't support that. If you have the same two chunks all the time, you can combine and then gzip once and send the one resulting chunk. On Fri, May 24, 2013 at

Re: [nodejs] HTTP - how to send multiple pre-cached gzipped chunks?

2013-05-24 Thread Sławek Janecki
Is there any way to 'hack' it? For example striping gzpi headers from 2nd gzip chunk? Or that header is binded to gziped data? On Friday, May 24, 2013 9:37:28 PM UTC+2, Tim Caswell wrote: gzip has internal headers that must only appear at the beginning. You can't send two gzip documents in

Re: [nodejs] HTTP - how to send multiple pre-cached gzipped chunks?

2013-05-24 Thread Tim Caswell
I'm afraid I don't know gzip format well enough to answer that. It's fairly well documented at http://www.gzip.org/zlib/rfc-gzip.html though. On Fri, May 24, 2013 at 2:42 PM, Sławek Janecki jane...@gmail.com wrote: Is there any way to 'hack' it? For example striping gzpi headers from 2nd

Re: [nodejs] HTTP - how to send multiple pre-cached gzipped chunks?

2013-05-24 Thread Matt
In *theory* you might be able to do this by sending two multipart/mixed MIME sections, each having a Content-Encoding: gzip header. But I can't imagine that any browser would support it and display it properly. On Fri, May 24, 2013 at 3:45 PM, Tim Caswell t...@creationix.com wrote: I'm afraid