0

I'm working with a JSF2 webapp. When I'm navigating between different pages they normally load fast; less than 100 ms. Sometimes though, for no apparent reason, it takes several seconds.

I've been trying to find some common denominator for when this occurs, but it happens regardless of page and regardless if I have visited the page several times before. Also, after a page has been slow to load, the next time I load it, it will load fast again for some time.

It all seems to happen randomly.

I have tried to find out what part of the application that takes time to carry out its task. I've timed more or less everything I can think of and it's not database calls, the logic in my classes or anything like that. Instead, looking at the "network" graph of chrome, it seems to be the initial call to the page that is the time thief.

Looking at the "network" diagram of Chrome, it shows that the latency for the first call is several seconds on those occasions.

Had this been due to my own bad code, I could at least have timed it and found out where I had made mistakes. Seeing that this seems to happen before my own code is even reached, I have no idea about how to solve this problem.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
nivis
  • 913
  • 3
  • 17
  • 34

1 Answers1

0

This may not be the actual reason to the problem, but I noticed that my internet connection was going up and down, which seems to affect the application even though I'm running a local server.

If I have made a request to the application and the internet connection goes down, the requested page won't load and as soon as the connection is back, the page loads.

I didn't think that this would affect the application at all, as the server is local and I can inactivate the internet connection and still access the application.

nivis
  • 913
  • 3
  • 17
  • 34
  • You got some references to external resources on your pages ? some CDN for jquery for example ? – Daniel Nov 30 '12 at 14:06
  • Hmm. Well. There are the usual namespace links but nothing else that I can think of. What bewilders me is that it works if I inactivate my internet connections, while it doesn't work if the connection drops intermittently. – nivis Nov 30 '12 at 14:37