JSon and compression

You must Login before you can answer or comment on any questions.

Hello,

I have to retrieve json datas from a server. It works fine. The only problem I have, is that I have to retrieve a lot of records to fill my table and it produce a quite huge json file. Is there a way to compress the json in server side (PHP) and decompress it on the mobile before opening it ? and how ?

Regards

3 Answers

Do you really have to load all the data in one shot? There is only so much your phone will show in one screen without scrolling. Maybe you should load it progressively, depending of the scroll position.

Thanks Luc for your reply. the problem is that if the user want to use the search bar and and all datas are not loaded...

— answered 2 years ago by Armindo Da Silva
answer permalink
2 Comments
  • http://www.sencha.com/forum/showthread.php?67919-JSON-Gzip-Compression

    — commented 2 years ago by Luc Martin

  • Well, depending on the size of the data you want to search, you can use a php function for the search then access it using a Titanium.Network.createHTTPClient()

    — commented 2 years ago by Luc Martin

well I have fond this module : https://github.com/TermiT/ZipFile

and using gzcompress on the php server side reduce the json output fron 115kb to 15 kb.

will have to try the module now. also will try to minimize field name in the json output like in your link.

Your Answer

Think you can help? Login to answer this question!