• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

gzip content vs. regular content

 
Niral Trivedi
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to send gzip content in one of our servlet. And it is working correctly. But comparing response time bet'n sending gzip content and regular content is alsmot same. Isn't gzip content response time should be faster?
The page I am trying contains many images as well as lots of other text content. Then what might be the reason?
Is it because my webserver and JRUN is on same physical machine?
Thanks in advance.
 
john guthrie
Ranch Hand
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i could believe this. a bunch of small images compressed won't be much small than a bunch of small images uncompressed. and you are still making all the same number of requests, which is probably where the bulk of the latency is.
 
danny liu
Ranch Hand
Posts: 185
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
compression is only useful when the bandwidth is narrow and message is huge.
for small message or running on a broadband network, compression benefits little, cause compression also incurs an overhead.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by danny liu:
compression is only useful when the bandwidth is narrow and message is huge.
for small message or running on a broadband network, compression benefits little, cause compression also incurs an overhead.

Really what danny liu mentioned above is reasonable, compression has processing overhead... If there is a broadband network, sending uncompressed message, which is small, is alright...
In messaging issue like this, we always have to think about the trade-offs between processing time and delivery dealy time....
 
Jayson Falkner
Author
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a note, compression is always fairly helpful. Sending the same content using less bandwidth is ideal. However, normally you only want to compress your web pages (e.g. HTML, JavaScript, CSS) and not images. Most image formats provide a method to already be compressed, which means you don't benefit much by doing it on the server-side. Of course, you'll really notice compression the most when sending a large web page over a slow connection.
About the issue of how long it takes to compress content. Yes, compressing content takes time. However, if your server isn't taxed, you might as well compress. Plus you can always cache compressed responses so that you aren't compressing every page on the fly.
Hope that helps!.
 
Niral Trivedi
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your responses.
As Jayson said, I read article on O'Reilly about compression and cache filter. But the thing is, we are using Servlet 2.2 and that's why can not use Filter yet. We are going to move ultimately to newer Websphere version but till than we want to utilize such a good practice.
So, I want to do similar compression through our controller servlet. So, in that case, as Jayson suggested, how can we separate HTML,JavaScript from gif/jpg files?
Thanks again.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic