Hello, We have to POST a bulk of XML data via AJAX. At the moment it''s about 150Kb but tends to grow even more. Are where any open source JS implementations of general purpose archiving algos (ZLW and such)? The idea is quiet simple- zip the data at clients browser (it''s about 2Kb only if zipped) and unzip it on server side. Any advice would be greatly appreciated. Dmitry Zegebart. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hello, We have to POST a bulk of XML data via AJAX. At the moment it''s about 150Kb but tends to grow even more. Are where any open source JS implementations of general purpose archiving algos (ZLW and such)? The idea is quiet simple- zip the data at clients browser (it''s about 2Kb only if zipped) and unzip it on server side. Any advice would be greatly appreciated. Dmitry Zegebart. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Scott Bronson
2007-Oct-12 20:13 UTC
Re: Javascript implementation of LZW or similar algorithm
When I looked into this two years ago, just zipping up the data in javascript took a lot longer than the transfer! It''s not easy to write efficient compression client-side. JavaScript, alas, doesn''t provide any compression APIs. There are one or two partially-complete LZW libraries out there... googling should turn one up. I don''t think you''ll be happy with them though. Personally, if I needed to do this now, I would first try to use a marshaling protocol that''s a lot more space-efficient than XML (maybe tab-delimited). Then, if that didn''t buy enough, I''d write my own compressor based on LZO or some other time-optimized compression schem. Google "BMDiff Zippy" for Google''s solution. Dunno if they''re available though. Good luck! On 10/12/07, Keks Keksov <keksov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hello, > > We have to POST a bulk of XML data via AJAX. At the moment it''s about > 150Kb but tends to grow even more. Are where any open source JS > implementations of general purpose archiving algos (ZLW and such)? The > idea is quiet simple- zip the data at clients browser (it''s about 2Kb > only if zipped) and unzip it on server side. > > Any advice would be greatly appreciated. > > Dmitry Zegebart. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Keks Keksov
2007-Oct-13 01:13 UTC
Re: Javascript implementation of LZW or similar algorithm
Thanks a lot! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Richard Quadling
2007-Oct-15 09:31 UTC
Re: Javascript implementation of LZW or similar algorithm
On 13/10/2007, Keks Keksov <keksov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Thanks a lot!Not tested and unsure if it works, but if you have server side gzip compression enabled, what is the consequence then? A header of ... Content-Encoding: gzip or Content-Encoding: deflate depending upon the support from the client for this. Theoretically, the server compresses and transmits and the client receives and decompresses completely transparently. I use a modified version of the PHP code available at http://rakaz.nl/projects/combine/combine.phps / http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files Admittedly, I''ve not used this on my AJAX responses as they are VERY small and I tend to use an X-JSON header. -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---