• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reduce string size to improve download speed  RSS feed

 
Trelston Moraes
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am facing some issue with the performance of a certain page on my website.Now, onclick of a link i send an ajax request to the server to get some data. Now the data is 88kb in size which obviously is very big and on a slow bandwidth is takes sometime to load. So, is there a way in which i can compress the data and then decompress it on the client using javascript(I Kno this is a java website but im really in need).

Thanks in advance
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use HTTP compression. How you implement that depends on the web server you are using (for example if its Apache HTTP Server you use mod_deflate or mod_gzip). There is extra load on the server because of this, but the size of the data is reduced.
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course handling the compression can put an extra load on your CPU in place of the load on your data, and it may not gain you much if the network hardware is already transparently compressing/decompressing.

It's a good option to have, but one of the appealing things about AJAX is that it can make webapps more responsive by doing incremental page updates on demand instead of making the user wait while the whole ball of wax reloads. See if there's any of that 88K of data that can be skipped over by doing differential data transfers.
 
Trelston Moraes
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help. I have found that a lot of the data that is coming can actually be processed on the client side. They are mostly html tags and that was what was making the data heavy. So now i return an xml file with only the important data which is only 20kb in size and then i parse that xml file on the client where i add these tags. So things are noe happening faster
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!