Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using gzip in jsp files

 
Vinay Singh
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to speed up the performance of my application . I am using firebug and Yslow has recommended some techniques.
One of the issues we have is that there are around 24 java script files which are loaded every time. That mean 24 requests.
We cannot club them into one from maintainability perspective .
So the other option is compress these files using gzip. I downloaded the utility from gzip site http://www.gzip.org/

I am can compress the file using gzip and it is transmitted successfully.

The problem arises when app tries to use validation inside these files. The java script code is not executed.
I think the reason could be that the browser is not able to decompress the file

This was original code in jsp

<script type="text/javascript" src="<c:url value="/scripts/lib/validate.js"/>"></script>

the .js has been replaced with .js.gz
<script type="text/javascript" src="<c:url value="/scripts/lib/validate.js.gz"/>"></script>


I am not sure if we would have to manually gzip the files or we enable some flag in server which serves the files as gzip files from server.

Any help is appreciated
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on HTML.

For more information, please read this.

This post has been moved to a more appropriate forum.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not how gzipping from the server works AFAIK--you're just sending a binary file without providing the client any way of knowing what it's receiving.

The canonical way to do this is to use a gzip filter, of which there are an abundance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic