1

i am trying to improve the performance of my web application. It is a java based web application & deployed on an amazon cloud server with Jboss & apache.

There is one page in the application that is taking 13-14 seconds to open. The functionality is so much that there are about 100+ http requests that get executed on page loading time. The Js & css files are taking too much time to load.

So i moved all of the Javascript code from my JSP page to new JS files. Minified the JS & css files. Still there is not much difference in the page load time.

There is dojo data on this page as well which takes time to load.

Is there any other appproach i should try to tune this page?

Can something be done at the Jboss or Apache level?

2
  • You probably need to get a bit more detailed than this for anyone to be able to help you, like using your browser to make a performance profile. Commented Aug 30, 2015 at 12:18
  • Apologies for the question not being precise as i am new here. Could you please tell me any api wherein i can bundle my css & js files at build time or run time for a java web application??
    – Bhavik
    Commented Sep 1, 2015 at 4:44

1 Answer 1

1
  1. Apply caching for images etc. More here
  2. Use CDN for any external libraries you use (like jquery). More here
  3. Use a library for your js scripts like RequireJS to optimize your css and js files. You can concatenate (merge multiple js files to one) your code. This will reduce the number of ajax calls (that's what the browser does when it sees a js or css dependency) (As @Ken Franqueiro mentions in the comment section, Dojo already has a mechanism for this). More here
  4. Optimize your images. Use appropriate dimensions. Do not use full blown dimensions if you just intend to use it for a 10x10 container. Use sprites if possible. More here
  5. Show a message/loader to show the user some progress. This will minimize the user restlessness More here
  6. If you load data that takes too long, then show the page and load the data afterwards. This will too give some sense of progress to the user.
  7. If the response is very big you can compress your response data. Be careful though that the browsers your application supports, can handle the compressed information by default, or add a custom mechanism to decompress the data. More here

Use some profiling tools like Chrome Development Tools or FireBug for Mozilla. Take a snapshot of your network traffic and check where the bottleneck is. In Chrome you press F12 and then select the Network tab.

5
  • 1
    FWIW, Dojo also has a build system (somewhat akin to RequireJS's) which allows you to define "layers" to minimize the number of requests that need to be made for client-side module dependencies. There is a build tutorial though I would say it errs on the side of being overly exhaustive. Commented Aug 31, 2015 at 4:25
  • I've never used Dojo so I didn't know that. Thanks for the info. Commented Aug 31, 2015 at 6:30
  • Thanks a lot for your reply.
    – Bhavik
    Commented Aug 31, 2015 at 7:26
  • Thanks a lot for your reply. As mentioned earlier the number of http requests on my page are very high. I came across some modules which can help me reduce these requests by combining CSS , JS & Image files. So i found Google PageSpeed Module & Cloudfare for this purpose. is there any other api i can use for this purpose? Because apparently Google has shut down Page Speed and cloudfare says my website is invalid. Also pagespeed packages are only available on Ubuntu & Fedora but not windows.
    – Bhavik
    Commented Aug 31, 2015 at 7:32
  • I don't know this module but I've already mentioned RequireJS that can do this. Moreover as @KenFranqueiro mentions above, Dojo (that you already are using) can do the same thing (combine resources to reduce http calls). Check this stackoverflow.com/questions/13853876/… Commented Aug 31, 2015 at 7:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.