NetTalk Central

Author Topic: Dynamic web pages: GZIP compressing on-the-fly  (Read 2971 times)

patrick de laet

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • ShopPlus
    • Email
Dynamic web pages: GZIP compressing on-the-fly
« on: June 07, 2011, 07:17:32 AM »
From my webserver, I have to send a dynamic web page with a huge <table> (more than 1000 <tr> each 5<td>).
Is there a way to gzip compress my packet in real-time (on-the-fly)?
I remember that is was on the NetTalk todo list, a few years ago.
Is it already done?

regards

Patrick De Laet
patrick@fijisoft.be


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Dynamic web pages: GZIP compressing on-the-fly
« Reply #1 on: June 07, 2011, 10:48:29 PM »
Hi Patrick,

unfortunately, no, it's not done yet.

cheers
Bruce

patrick de laet

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • ShopPlus
    • Email
Re: Dynamic web pages: GZIP compressing on-the-fly
« Reply #2 on: June 08, 2011, 12:09:18 AM »
Any hint where I can do it myself?
In which embed?
Is there an embed where the whole page is available, just before sending to the browser, including the HEADERs?

regards

Patrick

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Dynamic web pages: GZIP compressing on-the-fly
« Reply #3 on: June 08, 2011, 03:51:26 AM »
Hi Patrick,

>> Any hint where I can do it myself? In which embed? Is there an embed where the whole page is available, just before sending to the browser, including the HEADERs?

alas, no it's not that simple.
The response packets are sent out to the browser as they are generated. They typically ultimately flow through the .SendString method in the WebHandler.

My guess is that the implementation rests on a few things;

a) check the browser has "accept gzip" on. you can check the p_web.RequestGzip property = 1 for this;

b) have some sort of "start buffer" and "end buffer" points. perhaps this is just when the connection opens, and closes  - or perhaps it has to be explicit, I'm not sure.

c) redirect the data flowing into SendString so it is redirected to a memory buffer.

d) then at the end point, compress the whole buffer and send it.

Not surprisingly there are some vague bits in the above - there is much I'd need to test to provide a complete solution.

cheers
Bruce